switched to gan and train.py.

This commit is contained in:
k
2025-09-05 14:38:45 -04:00
parent 5df1e5df7e
commit ccc3fa3ed4
4 changed files with 147 additions and 83 deletions

13
show.py
View File

@@ -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()