mirror of
https://github.com/correl/dejavu.git
synced 2024-11-23 11:09:52 +00:00
Added more documentation in README about testing
This commit is contained in:
parent
60d9d6758e
commit
a7f77d50ff
4 changed files with 10 additions and 3 deletions
|
@ -124,6 +124,10 @@ Or by reading files via scripting functions:
|
||||||
|
|
||||||
## Testing (New!)
|
## 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:
|
Test your Dejavu settings on a corpus of audio files on a number of different metrics:
|
||||||
|
|
||||||
* Confidence of match (number fingerprints aligned)
|
* 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
|
* Song matching accuracy
|
||||||
* Time to match
|
* Time to match
|
||||||
|
|
||||||
|
![Accuracy](plots/matching_graph.png)
|
||||||
|
|
||||||
An example script is given in `test_dejavu.sh`, shown below:
|
An example script is given in `test_dejavu.sh`, shown below:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
|
@ -4,17 +4,18 @@ import json
|
||||||
warnings.filterwarnings("ignore")
|
warnings.filterwarnings("ignore")
|
||||||
|
|
||||||
# load config from a JSON file (or anything outputting a python dictionary)
|
# 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)
|
config = json.load(f)
|
||||||
|
|
||||||
# create a Dejavu instance
|
# create a Dejavu instance
|
||||||
djv = Dejavu(config)
|
djv = Dejavu(config)
|
||||||
|
|
||||||
# Fingerprint all the mp3's in the directory we give it
|
# Fingerprint all the mp3's in the directory we give it
|
||||||
djv.fingerprint_directory("mp3", [".mp3"])
|
djv.fingerprint_directory("mp3", [".mp3"])
|
||||||
|
|
||||||
# Recognize audio from a file
|
# Recognize audio from a file
|
||||||
from dejavu.recognize import FileRecognizer
|
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
|
# Or recognize audio from your microphone for 10 seconds
|
||||||
from dejavu.recognize import MicrophoneRecognizer
|
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
|
# Or use a recognizer without the shortcut, in anyway you would like
|
||||||
from dejavu.recognize import FileRecognizer
|
from dejavu.recognize import FileRecognizer
|
||||||
recognizer = FileRecognizer(djv)
|
recognizer = FileRecognizer(djv)
|
||||||
song = recognizer.recognize_file("mp3/sail.mp3")
|
song = recognizer.recognize_file("mp3/Josh-Woodward--I-Want-To-Destroy-Something-Beautiful.mp3")
|
BIN
plots/confidence.png
Normal file
BIN
plots/confidence.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
BIN
plots/matching_graph.png
Normal file
BIN
plots/matching_graph.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
Loading…
Reference in a new issue