From 23502290e45f897c0837bfc91eb479666aebc82f Mon Sep 17 00:00:00 2001 From: Lapin Date: Sat, 5 Jun 2021 22:28:26 +0200 Subject: [PATCH] fix: ajust the name from the downloaded song --- cover_song_identification.py | 35 +---------------------------------- cover_song_stream.py | 8 ++++---- 2 files changed, 5 insertions(+), 38 deletions(-) diff --git a/cover_song_identification.py b/cover_song_identification.py index 4164631..80c6a63 100644 --- a/cover_song_identification.py +++ b/cover_song_identification.py @@ -18,25 +18,19 @@ import essentia.standard as estd from essentia.pytools.spectral import hpcpgram 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_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/Bella Poarch - Build a Btch (Official Music Video).mp3' +different_song = 'audio/Jacques Brel - Ne Me Quitte Pas.mp3' IPython.display.Audio(yesterday_original) IPython.display.Audio(yesterday_cover_01) -IPython.display.Audio(yesterday_cover_02) IPython.display.Audio(different_song) # query cover song original_song = estd.MonoLoader(filename=yesterday_original, 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 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) 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) @@ -84,15 +77,6 @@ plt.ylabel('Yesterday - The Beatles') 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) -## 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. score_matrix, distance = estd.CoverSongSimilarity(disOnset=0.5, diff --git a/cover_song_stream.py b/cover_song_stream.py index b3b39b8..c64a2fb 100644 --- a/cover_song_stream.py +++ b/cover_song_stream.py @@ -10,9 +10,10 @@ from essentia.pytools.spectral import hpcpgram yesterday_original = 'audio/Yesterday (Remastered 2009).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 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 from essentia import array, run, Pool -query_filename = wrong_song # 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)