From acca344f23a1e2e98e01509e2c020f90f5fd22ba Mon Sep 17 00:00:00 2001 From: mrepetto Date: Sun, 13 Oct 2019 18:01:34 -0300 Subject: [PATCH] Updated readme and fixed a gramma error --- README.md | 16 +++++++++------- dejavu/__init__.py | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4f8a858..5a0d164 100755 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ Second, you'll need to create a MySQL database where Dejavu can store fingerprin Now you're ready to start fingerprinting your audio collection! +Obs: The same from above goes for postgres database if you want to use it. + ## Quickstart ```bash @@ -81,7 +83,7 @@ The following keys are mandatory: The following keys are optional: * `fingerprint_limit`: allows you to control how many seconds of each audio file to fingerprint. Leaving out this key, or alternatively using `-1` and `None` will cause Dejavu to fingerprint the entire audio file. Default value is `None`. -* `database_type`: as of now, only `mysql` (the default value) is supported. If you'd like to subclass `Database` and add another, please fork and send a pull request! +* `database_type`: `mysql` (the default value) and `postgres` are supported. If you'd like to add another subclass for `BaseDatabase` and implement a new type of database, please fork and send a pull request! An example configuration is as follows: @@ -102,16 +104,16 @@ An example configuration is as follows: ## Tuning -Inside `fingerprint.py`, you may want to adjust following parameters (some values are given below). +Inside `config/settings.py`, you may want to adjust following parameters (some values are given below). FINGERPRINT_REDUCTION = 30 PEAK_SORT = False DEFAULT_OVERLAP_RATIO = 0.4 - DEFAULT_FAN_VALUE = 10 - DEFAULT_AMP_MIN = 15 - PEAK_NEIGHBORHOOD_SIZE = 30 + DEFAULT_FAN_VALUE = 5 + DEFAULT_AMP_MIN = 10 + PEAK_NEIGHBORHOOD_SIZE = 10 -These parameters are described in the `fingerprint.py` in detail. Read that in-order to understand the impact of changing these values. +These parameters are described within the file in detail. Read that in-order to understand the impact of changing these values. ## Recognizing @@ -123,7 +125,7 @@ Through the terminal: ```bash $ python dejavu.py --recognize file sometrack.wav -{'song_id': 1, 'song_name': 'Taylor Swift - Shake It Off', 'confidence': 3948, 'offset_seconds': 30.00018, 'match_time': 0.7159781455993652, 'offset': 646L} +{'total_time': 2.863781690597534, 'fingerprint_time': 2.4306554794311523, 'query_time': 0.4067542552947998, 'align_time': 0.007731199264526367, 'results': [{'song_id': 1, 'song_name': 'Taylor Swift - Shake It Off', 'input_total_hashes': 76168, 'fingerprinted_hashes_in_db': 4919, 'hashes_matched_in_input': 794, 'input_confidence': 0.01, 'fingerprinted_confidence': 0.16, 'offset': -924, 'offset_seconds': -30.00018, 'file_sha1': b'3DC269DF7B8DB9B30D2604DA80783155912593E8'}, {...}, ...]} ``` or in scripting, assuming you've already instantiated a Dejavu object: diff --git a/dejavu/__init__.py b/dejavu/__init__.py index 5173824..fac72bc 100755 --- a/dejavu/__init__.py +++ b/dejavu/__init__.py @@ -121,7 +121,7 @@ class Dejavu: def fingerprint_file(self, file_path: str, song_name: str = None) -> None: """ Given a path to a file the method generates hashes for it and stores them in the database - for later being queried. + for later be queried. :param file_path: path to the file. :param song_name: song name associated to the audio file.