diff --git a/README.md b/README.md index cb314d7..3380f51 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,8 @@ The following features are included in the application: To set up the application, you need Python 3. After cloning the repository change to the project directory and install the dependencies via: ``` -python3 -m pip install requirements.txt +apt-get install gcc nano ffmpeg libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0 postgresql postgresql-contrib -y +python3 -m pip install -r requirements.txt ``` ## Development @@ -73,7 +74,34 @@ pytest --host http://localhost:8600 https://github.com/worldveil/dejavu/blob/master/mp3/Brad-Sucks--Total-Breakdown.mp3 -> QmU3XRYZiebdDMcUwKrvecxyDgtgVY6zaNYrzQBeCkFb2r +```bash curl -X POST "http://localhost:8600/api/v1/mazash/recognize" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"cid\":\"QmU3XRYZiebdDMcUwKrvecxyDgtgVY6zaNYrzQBeCkFb2r\",\"extension\":\".mp3\",\"song\":\"Brad-Sucks--Total-Breakdown\"}" +``` +```bash +curl -X POST "http://localhost:8600/api/v1/mazash/recognize" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"cid\":\"QmU3XRYZiebdDMcUwKrvecxyDgtgVY6zaNYrzQBeCkFb2r\",\"extension\":\".mp3\"}" +``` -curl -X POST "http://localhost:8600/api/v1/mazash/recognize" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"cid\":\"QmU3XRYZiebdDMcUwKrvecxyDgtgVY6zaNYrzQBeCkFb2r\",\"extension\":\".mp3\"}" \ No newline at end of file +response : + +```json +{ + "align_time": 0.11919093132019043, + "fingerprint_time": 4.459228992462158, + "query_time": 2.729705810546875, + "results": [ + { + "file_sha1": "02A83F248EFDA76A46C8B2AC97798D2CE9BC1FBE", + "fingerprinted_confidence": 1, + "fingerprinted_hashes_in_db": 75062, + "hashes_matched_in_input": 75062, + "input_confidence": 1, + "input_total_hashes": 75062, + "offset": 0, + "offset_seconds": 0, + "song_id": 1, + "song_name": "Brad-Sucks--Total-Breakdown" + } + ], + "total_time": 7.348343849182129 +}``` \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index cb2054f..6113dd4 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -24,7 +24,7 @@ services: python: build: context: ./python - entrypoint: bash -c "pip install -r requirements.txt && pip install https://github.com/worldveil/dejavu/zipball/master && /code/run_app_prod.sh" + entrypoint: bash -c "pip install -r requirements.txt && /code/run_app_prod.sh" environment: - POSTGRES_HOST=mazash_db_1.mazash_db_networks - POSTGRES_DB=dejavu diff --git a/requirements.txt b/requirements.txt index e6c0c48..ccdecdd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,5 +14,8 @@ marshmallow flask_swagger_ui openapi_spec_validator +#dejavu +git+git://github.com/worldveil/dejavu@e56a4a221ad204654a191d217f92aebf3f058b62 + #ipfs ipfsapi