switched to gan and train.py.
This commit is contained in:
13
show.py
13
show.py
@@ -1,18 +1,21 @@
|
||||
import matplotlib.pyplot as plt
|
||||
import IPython.display as ipd
|
||||
import librosa
|
||||
import mlflow
|
||||
|
||||
|
||||
SAMPLE_RATE = 22050
|
||||
|
||||
def showSpec(spec):
|
||||
def logSpec(spec,e):
|
||||
#spec = ((spec*40)-40)
|
||||
#spec = librosa.db_to_amplitude(spec)
|
||||
plt.figure(figsize=(10, 4))
|
||||
librosa.display.specshow(spec, sr=SAMPLE_RATE,
|
||||
x_axis='time', y_axis='mel',
|
||||
cmap='viridis')
|
||||
plt.colorbar(format='%+2.0f dB')
|
||||
plt.title('Mel spectrogram')
|
||||
plt.show()
|
||||
mlflow.log_figure(plt.gcf(), f"output_{e}.png")
|
||||
#plt.close()
|
||||
|
||||
def playSpec(spec):
|
||||
S = librosa.feature.inverse.mel_to_stft(spec, sr=SAMPLE_RATE)
|
||||
@@ -21,6 +24,4 @@ def playSpec(spec):
|
||||
plt.figure(figsize=(12,4))
|
||||
plt.plot(audio)
|
||||
plt.title('waveform')
|
||||
plt.show()
|
||||
|
||||
display(ipd.Audio(audio,rate=SAMPLE_RATE))
|
||||
plt.close()
|
||||
|
||||
Reference in New Issue
Block a user