diff --git a/README.md b/README.md index 11e3fb4..44c3c63 100755 --- a/README.md +++ b/README.md @@ -124,6 +124,10 @@ Or by reading files via scripting functions: ## Testing (New!) +Testing out different parameterizations of the fingerprinting algorithm is often useful as the curpus becomes larger and larger, and inevitable tradeoffs between speed and accuracy come into play. + +![Confidence](plots/confidence.png) + Test your Dejavu settings on a corpus of audio files on a number of different metrics: * Confidence of match (number fingerprints aligned) @@ -131,6 +135,8 @@ Test your Dejavu settings on a corpus of audio files on a number of different me * Song matching accuracy * Time to match +![Accuracy](plots/matching_graph.png) + An example script is given in `test_dejavu.sh`, shown below: ```bash diff --git a/example.py b/example.py index 0268a03..e2769cb 100755 --- a/example.py +++ b/example.py @@ -4,17 +4,18 @@ import json warnings.filterwarnings("ignore") # load config from a JSON file (or anything outputting a python dictionary) -with open("dejavu.cnf") as f: +with open("dejavu.cnf.SAMPLE") as f: config = json.load(f) # create a Dejavu instance djv = Dejavu(config) + # Fingerprint all the mp3's in the directory we give it djv.fingerprint_directory("mp3", [".mp3"]) # Recognize audio from a file from dejavu.recognize import FileRecognizer -song = djv.recognize(FileRecognizer, "mp3/beware.mp3") +song = djv.recognize(FileRecognizer, "mp3/Sean-Fournier--Falling-For-You.mp3") # Or recognize audio from your microphone for 10 seconds from dejavu.recognize import MicrophoneRecognizer @@ -23,4 +24,4 @@ song = djv.recognize(MicrophoneRecognizer, seconds=2) # Or use a recognizer without the shortcut, in anyway you would like from dejavu.recognize import FileRecognizer recognizer = FileRecognizer(djv) -song = recognizer.recognize_file("mp3/sail.mp3") \ No newline at end of file +song = recognizer.recognize_file("mp3/Josh-Woodward--I-Want-To-Destroy-Something-Beautiful.mp3") \ No newline at end of file diff --git a/plots/confidence.png b/plots/confidence.png new file mode 100644 index 0000000..33db2b2 Binary files /dev/null and b/plots/confidence.png differ diff --git a/plots/matching_graph.png b/plots/matching_graph.png new file mode 100644 index 0000000..308126e Binary files /dev/null and b/plots/matching_graph.png differ