worldveil / dejavu

Audio fingerprinting and recognition in Python
MIT License
6.36k stars 1.43k forks source link

0% accuracy #247

Open ATheCoder opened 3 years ago

ATheCoder commented 3 years ago

I have added about 13 MP3s to the database, using the following script:

import json

from dejavu import Dejavu
from dejavu.logic.recognizer.file_recognizer import FileRecognizer
from dejavu.logic.recognizer.microphone_recognizer import MicrophoneRecognizer

# load config from a JSON file (or anything outputting a python dictionary)
config = {
    "database": {
        "host": "db",
        "user": "postgres",
        "password": "password",
        "database": "dejavu"
    },
    "database_type": "postgres"
}

if __name__ == '__main__':

    # create a Dejavu instance
    djv = Dejavu(config)

    # Fingerprint all the mp3's in the directory we give it
    djv.fingerprint_directory("mp3s", [".mp3"], 1)

Then I ran the tests by changing the sample config to:

{
    "database": {
        "host": "db",
        "user": "postgres",
        "password": "password",
        "database": "dejavu"
    },
    "database_type": "postgres"
}

and running:

python run_tests.py     --sec 5     --temp ./temp_audio     --log-file ./results/dejavu-test.log     --padding 8     --seed 42     --results ./results     ./mp3

None of the songs seem to match!

--------------------------------------------------
file: azan_test_187_4sec.wav
song: azan_test
song_result: Riverside The Depth of Self-Delusion
invalid match
--------------------------------------------------

--------------------------------------------------
file: Choc--Eigenvalue-Subspace-Decomposition_24_3sec.mp3
song: Choc--Eigenvalue-Subspace-Decomposition
song_result: Opeth The Drapery Falls
invalid match
--------------------------------------------------

--------------------------------------------------
file: Choc--Eigenvalue-Subspace-Decomposition_222_5sec.mp3
song: Choc--Eigenvalue-Subspace-Decomposition
song_result: The Moody Blues Melancholy Man
invalid match
--------------------------------------------------

--------------------------------------------------
file: Choc--Eigenvalue-Subspace-Decomposition_21_4sec.mp3
song: Choc--Eigenvalue-Subspace-Decomposition
song_result: Soen Lotus
invalid match
--------------------------------------------------

--------------------------------------------------
file: Sean-Fournier--Falling-For-You_58_4sec.mp3
song: Sean-Fournier--Falling-For-You
song_result: Riverside The Depth of Self-Delusion
invalid match
--------------------------------------------------

--------------------------------------------------
file: Josh-Woodward--I-Want-To-Destroy-Something-Beautiful_158_5sec.mp3
song: Josh-Woodward--I-Want-To-Destroy-Something-Beautiful
song_result: Riverside We Got Used To Us
invalid match
--------------------------------------------------

--------------------------------------------------
file: The-Lights-Galaxia--While-She-Sleeps_79_5sec.mp3
song: The-Lights-Galaxia--While-She-Sleeps
song_result: Riverside We Got Used To Us
invalid match
--------------------------------------------------

--------------------------------------------------
file: Sean-Fournier--Falling-For-You_78_1sec.mp3
song: Sean-Fournier--Falling-For-You
song_result: Zedbazi Yakh
invalid match
--------------------------------------------------

--------------------------------------------------
file: Josh-Woodward--I-Want-To-Destroy-Something-Beautiful_191_4sec.mp3
song: Josh-Woodward--I-Want-To-Destroy-Something-Beautiful
song_result: Opeth All Things Will Pass
invalid match
--------------------------------------------------

--------------------------------------------------
file: Josh-Woodward--I-Want-To-Destroy-Something-Beautiful_63_3sec.mp3
song: Josh-Woodward--I-Want-To-Destroy-Something-Beautiful
song_result: Riverside The Depth of Self-Delusion
invalid match
--------------------------------------------------

--------------------------------------------------
file: The-Lights-Galaxia--While-She-Sleeps_174_4sec.mp3
song: The-Lights-Galaxia--While-She-Sleeps
song_result: The Moody Blues Melancholy Man
invalid match
--------------------------------------------------

--------------------------------------------------
file: Brad-Sucks--Total-Breakdown_94_2sec.mp3
song: Brad-Sucks--Total-Breakdown
song_result: The Moody Blues Melancholy Man
invalid match
--------------------------------------------------

--------------------------------------------------
file: The-Lights-Galaxia--While-She-Sleeps_65_1sec.mp3
song: The-Lights-Galaxia--While-She-Sleeps
song_result: Riverside We Got Used To Us
invalid match
--------------------------------------------------

--------------------------------------------------
file: Brad-Sucks--Total-Breakdown_36_5sec.mp3
song: Brad-Sucks--Total-Breakdown
song_result: Zedbazi Yakh
invalid match
--------------------------------------------------

--------------------------------------------------
file: azan_test_43_1sec.wav
song: azan_test
song_result: The Moody Blues Melancholy Man
invalid match
--------------------------------------------------

--------------------------------------------------
file: Sean-Fournier--Falling-For-You_31_3sec.mp3
song: Sean-Fournier--Falling-For-You
song_result: Soen Lotus
invalid match
--------------------------------------------------

--------------------------------------------------
file: azan_test_9_5sec.wav
song: azan_test
song_result: Riverside The Depth of Self-Delusion
invalid match
--------------------------------------------------

--------------------------------------------------
file: Sean-Fournier--Falling-For-You_122_5sec.mp3
song: Sean-Fournier--Falling-For-You
song_result: The Moody Blues Melancholy Man
invalid match
--------------------------------------------------

--------------------------------------------------
file: Brad-Sucks--Total-Breakdown_79_4sec.mp3
song: Brad-Sucks--Total-Breakdown
song_result: Riverside We Got Used To Us
invalid match
--------------------------------------------------

--------------------------------------------------
file: Josh-Woodward--I-Want-To-Destroy-Something-Beautiful_70_1sec.mp3
song: Josh-Woodward--I-Want-To-Destroy-Something-Beautiful
song_result: Opeth The Drapery Falls
invalid match
--------------------------------------------------

--------------------------------------------------
file: Josh-Woodward--I-Want-To-Destroy-Something-Beautiful_30_2sec.mp3
song: Josh-Woodward--I-Want-To-Destroy-Something-Beautiful
song_result: Riverside The Depth of Self-Delusion
invalid match
--------------------------------------------------

--------------------------------------------------
file: Sean-Fournier--Falling-For-You_147_2sec.mp3
song: Sean-Fournier--Falling-For-You
song_result: Zedbazi Yakh
invalid match
--------------------------------------------------

--------------------------------------------------
file: Choc--Eigenvalue-Subspace-Decomposition_65_1sec.mp3
song: Choc--Eigenvalue-Subspace-Decomposition
song_result: Riverside We Got Used To Us
invalid match
--------------------------------------------------

--------------------------------------------------
file: Choc--Eigenvalue-Subspace-Decomposition_60_2sec.mp3
song: Choc--Eigenvalue-Subspace-Decomposition
song_result: Opeth The Drapery Falls
invalid match
--------------------------------------------------

--------------------------------------------------
file: Brad-Sucks--Total-Breakdown_11_3sec.mp3
song: Brad-Sucks--Total-Breakdown
song_result: Zedbazi Yakh
invalid match
--------------------------------------------------

--------------------------------------------------
file: The-Lights-Galaxia--While-She-Sleeps_67_3sec.mp3
song: The-Lights-Galaxia--While-She-Sleeps
song_result: Riverside We Got Used To Us
invalid match
--------------------------------------------------

--------------------------------------------------
file: Brad-Sucks--Total-Breakdown_11_1sec.mp3
song: Brad-Sucks--Total-Breakdown
song_result: Zedbazi Yakh
invalid match
--------------------------------------------------

--------------------------------------------------
file: azan_test_137_3sec.wav
song: azan_test
song_result: Opeth All Things Will Pass
invalid match
--------------------------------------------------

--------------------------------------------------
file: The-Lights-Galaxia--While-She-Sleeps_159_2sec.mp3
song: The-Lights-Galaxia--While-She-Sleeps
song_result: Opeth The Drapery Falls
invalid match
--------------------------------------------------

--------------------------------------------------
file: azan_test_116_2sec.wav
song: azan_test
song_result: The Moody Blues Melancholy Man
invalid match
--------------------------------------------------

What am I doing wrong?

My matching_prec_5sec.png is:

matching_perc_5sec

qqqays commented 3 years ago

Those song for fingerprint save into database which name must same as test song. image Try this. This script test accuracy that audio in different time span.