diff --git a/polymath.py b/polymath.py index 99921ec..48a9558 100755 --- a/polymath.py +++ b/polymath.py @@ -300,7 +300,7 @@ def get_pitch(y_harmonic, sr, beats): def get_timbre(y, sr, beats): # Mel spectogram - S = librosa.feature.melspectrogram(y, sr=sr, n_mels=128) + S = librosa.feature.melspectrogram(y=y, sr=sr, n_mels=128) log_S = librosa.power_to_db(S, ref=np.max) # MFCC - Timbre mfcc = librosa.feature.mfcc(S=log_S, n_mfcc=13) @@ -681,11 +681,11 @@ def main(): vid.audio_features = audio_features print( vid.id, - "tempo", round(audio_features["tempo"], 2), - "duration", round(audio_features["duration"], 2), - "timbre", round(audio_features["timbre"], 2), - "pitch", round(audio_features["pitch"], 2), - "intensity", round(audio_features["intensity"], 2), + "tempo", np.round(audio_features["tempo"], 2), + "duration", np.round(audio_features["duration"], 2), + "timbre", np.round(audio_features["timbre"], 2), + "pitch", np.round(audio_features["pitch"], 2), + "intensity", np.round(audio_features["intensity"], 2), "segments", len(audio_features["segments_boundaries"]), "frequency", round(audio_features["frequency"], 2), "key", audio_features["key"], diff --git a/requirements.txt b/requirements.txt index c447f84..207e24c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,12 @@ -crepe==0.0.13 -librosa==0.9.2 +crepe==0.0.16 +librosa==0.11.0 numpy>=1.20 -pyrubberband==0.3.0 +pyrubberband==0.4.0 sf_segmenter==0.0.2 -soundfile==0.11.0 -yt_dlp==2023.02.17 +soundfile==0.13.1 +yt_dlp==2025.09.26 demucs==4.0.0 -basic-pitch==0.2.0 +basic-pitch==0.4.0 matplotlib tensorflow==2.9; sys_platform == 'windows' or platform_machine != 'arm64' tensorflow-macos; sys_platform == 'darwin' and platform_machine == 'arm64'