fix: ajust the name from the downloaded song

This commit is contained in:
Lapin 2021-06-05 22:28:26 +02:00
parent 33925bbe3c
commit 23502290e4
2 changed files with 5 additions and 38 deletions

View File

@ -18,25 +18,19 @@ import essentia.standard as estd
from essentia.pytools.spectral import hpcpgram from essentia.pytools.spectral import hpcpgram
import IPython import IPython
#IPython.display.Audio('./en_vogue+Funky_Divas+09-Yesterday.mp3')
#IPython.display.Audio('./beatles+1+11-Yesterday.mp3')
#IPython.display.Audio('./aerosmith+Live_Bootleg+06-Come_Together.mp3')
yesterday_original = 'audio/Yesterday (Remastered 2009).mp3' yesterday_original = 'audio/Yesterday (Remastered 2009).mp3'
yesterday_cover_01 = 'audio/Yesterday - The Beatles - Connie Talbot (Cover).mp3' yesterday_cover_01 = 'audio/Yesterday - The Beatles - Connie Talbot (Cover).mp3'
yesterday_cover_02 = 'audio/The Beatles - Yesterday Saxophone Cover Alexandra Ilieva Thomann.mp3' different_song = 'audio/Jacques Brel - Ne Me Quitte Pas.mp3'
different_song = 'audio/Bella Poarch - Build a Btch (Official Music Video).mp3'
IPython.display.Audio(yesterday_original) IPython.display.Audio(yesterday_original)
IPython.display.Audio(yesterday_cover_01) IPython.display.Audio(yesterday_cover_01)
IPython.display.Audio(yesterday_cover_02)
IPython.display.Audio(different_song) IPython.display.Audio(different_song)
# query cover song # query cover song
original_song = estd.MonoLoader(filename=yesterday_original, sampleRate=32000)() original_song = estd.MonoLoader(filename=yesterday_original, sampleRate=32000)()
true_cover_01 = estd.MonoLoader(filename=yesterday_cover_01, sampleRate=32000)() true_cover_01 = estd.MonoLoader(filename=yesterday_cover_01, sampleRate=32000)()
true_cover_02 = estd.MonoLoader(filename=yesterday_cover_02, sampleRate=32000)()
# wrong match # wrong match
false_cover_1 = estd.MonoLoader(filename=different_song, sampleRate=32000)() false_cover_1 = estd.MonoLoader(filename=different_song, sampleRate=32000)()
@ -46,7 +40,6 @@ false_cover_1 = estd.MonoLoader(filename=different_song, sampleRate=32000)()
query_hpcp = hpcpgram(original_song, sampleRate=32000) query_hpcp = hpcpgram(original_song, sampleRate=32000)
true_cover_hpcp_1 = hpcpgram(true_cover_01, sampleRate=32000) true_cover_hpcp_1 = hpcpgram(true_cover_01, sampleRate=32000)
true_cover_hpcp_2 = hpcpgram(true_cover_02, sampleRate=32000)
false_cover_hpcp = hpcpgram(false_cover_1, sampleRate=32000) false_cover_hpcp = hpcpgram(false_cover_1, sampleRate=32000)
@ -84,15 +77,6 @@ plt.ylabel('Yesterday - The Beatles')
plt.imshow(true_pair_crp_1, origin='lower') plt.imshow(true_pair_crp_1, origin='lower')
true_pair_crp_2 = crp(query_hpcp, true_cover_hpcp_2)
fig = plt.gcf()
fig.set_size_inches(15.5, 5.5)
plt.title('Cross recurrent plot [1]')
plt.xlabel('Yesterday accapella cover')
plt.ylabel('Yesterday - The Beatles')
plt.imshow(true_pair_crp_2, origin='lower')
@ -154,23 +138,6 @@ plt.imshow(score_matrix, origin='lower')
print('Cover song similarity distance: %s' % distance) print('Cover song similarity distance: %s' % distance)
## other similar
score_matrix, distance = estd.CoverSongSimilarity(disOnset=0.5,
disExtension=0.5,
alignmentType='serra09',
distanceType='asymmetric')(true_pair_crp_2)
fig = plt.gcf()
fig.set_size_inches(15.5, 5.5)
plt.title('Cover song similarity distance: %s' % distance)
plt.xlabel('Yesterday accapella cover')
plt.ylabel('Yesterday - The Beatles')
plt.imshow(score_matrix, origin='lower')
print('Cover song similarity distance: %s' % distance)
## Computing cover song similarity distance between Yesterday - accapella cover and Come Together cover - The Aerosmith. ## Computing cover song similarity distance between Yesterday - accapella cover and Come Together cover - The Aerosmith.
score_matrix, distance = estd.CoverSongSimilarity(disOnset=0.5, score_matrix, distance = estd.CoverSongSimilarity(disOnset=0.5,

View File

@ -10,9 +10,10 @@ from essentia.pytools.spectral import hpcpgram
yesterday_original = 'audio/Yesterday (Remastered 2009).mp3' yesterday_original = 'audio/Yesterday (Remastered 2009).mp3'
yesterday_cover_01 = 'audio/Yesterday - The Beatles - Connie Talbot (Cover).mp3' yesterday_cover_01 = 'audio/Yesterday - The Beatles - Connie Talbot (Cover).mp3'
wrong_song = 'audio/Bella Poarch - Build a Btch (Official Music Video).mp3' wrong_song = 'audio/Jacques Brel - Ne Me Quitte Pas.mp3'
song_reference = yesterday_original song_reference = yesterday_original # the original song analysed in normal mode
song_streaming = wrong_song # the song get in stream mode to compare to reference
# query cover song # query cover song
original_song = estd.MonoLoader(filename=song_reference, sampleRate=32000)() original_song = estd.MonoLoader(filename=song_reference, sampleRate=32000)()
@ -27,11 +28,10 @@ true_cover_hpcp = hpcpgram(original_song, sampleRate=32000)
import essentia.streaming as estr import essentia.streaming as estr
from essentia import array, run, Pool from essentia import array, run, Pool
query_filename = wrong_song
# Let's instantiate all the required essentia streaming algorithms # Let's instantiate all the required essentia streaming algorithms
audio = estr.MonoLoader(filename=query_filename, sampleRate=32000) audio = estr.MonoLoader(filename=song_streaming, sampleRate=32000)
frame_cutter = estr.FrameCutter(frameSize=4096, hopSize=2048) frame_cutter = estr.FrameCutter(frameSize=4096, hopSize=2048)