Skip to content
Extraits de code Groupes Projets
Valider 330a28cf rédigé par Sting's avatar Sting
Parcourir les fichiers

More experiments

parent 4b16e769
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!2CNN + Spectral segmentation
...@@ -9,7 +9,7 @@ def segment(songfile): ...@@ -9,7 +9,7 @@ def segment(songfile):
delay = -4 delay = -4
smooth = 20 smooth = 20
threshold = 0.4 threshold = 1
cnn = madmom.features.onsets.CNNOnsetProcessor() cnn = madmom.features.onsets.CNNOnsetProcessor()
#proc = madmom.features.onsets.OnsetPeakPickingProcessor(threshold=threshold, smooth=smooth, delay=delay, fps=100) #proc = madmom.features.onsets.OnsetPeakPickingProcessor(threshold=threshold, smooth=smooth, delay=delay, fps=100)
...@@ -36,13 +36,15 @@ if __name__ == "__main__": ...@@ -36,13 +36,15 @@ if __name__ == "__main__":
activation_function = cnn(songfile, num_channels=1) activation_function = cnn(songfile, num_channels=1)
#onsets = proc(activation_function) #onsets = proc(activation_function)
onsets = madmom.features.onsets.peak_picking(activation_function, 0.4, smooth=20) onsets = madmom.features.onsets.peak_picking(activation_function, threshold=1, smooth=20)
#onset_smoothed = madmom.audio.signal.smooth(activation_function, 20)
print(onsets/100) print(onsets/100)
fig, axs = plt.subplots(nrows=2, sharex=True) fig, axs = plt.subplots(nrows=2, sharex=True)
axs[0].imshow(log_spec.T, origin='lower', aspect='auto') axs[0].imshow(log_spec.T, origin='lower', aspect='auto')
axs[1].plot(activation_function) axs[1].plot(activation_function)
#axs[1].plot(onset_smoothed, color='red')
axs[1].vlines(onsets, 0, 1, colors='red') axs[1].vlines(onsets, 0, 1, colors='red')
plt.show() plt.show()
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter