As Speaker Verification, a Python package, matures, the direction of its finial implementation needs to be considered. This project tends to be a continually evolving extension of Doubtfire. This direction, Speaker Verification API Based on Django, will serve as an effective way to guide next steps on how the project will proceed.
$ git clone https://github.com/OnTrack-UG-Squad/speaker-verification-api.git
$ cp sample_envs/.env.dev.db.sample .env.dev.db
$ cp sample_envs/.env.dev.sample .env.dev
POSTGRES_USER
, POSTGRES_PASSWORD
, POSTGRES_DB
in .env.dev.db
(Choose any user name and password)SQL_USER=POSTGRES_USER
, SQL_DATABASE=POSTGRES_DB
SQL_PASSWORD=POSTGRES_PASSWORD
Populate SECRET_KEY
in .env.dev
- Generate a key with the following Python command
$ python3 -c 'import random; result = "".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-*=+)") for i in range(50)]); print(result)'
Run the Docker containers
$ docker-compose -f docker-compose.yml up -d --build
http://localhost:8000
http://localhost:8000/redis-healthcheck
: Check the Redis
's health and the response would be Redis is connected successfully
http://localhost:8000/flower
: Redirects to the Flower
dashboardThe runtime output can be viewed via docker logs
POST /enroll
Request POST
Parameter | Type | Description |
---|---|---|
id | number | User ID |
recording_link | string | User's recording link |
Response | Field | Type | Description |
---|---|---|---|
success | boolean | The result of enrolment's processing |
POST /validate
Request POST
Parameter | Type | Description |
---|---|---|
id | number | User ID |
recording_link | string | User's recording link |
Response | Field | Type | Description |
---|---|---|---|
success | boolean | The result of enrolment's processing | |
data | object | The value contains the accuracy score |
Enrolling a user
Send POST request to http://localhost:8000/enroll with the content:
{
"id": 123456789,
"recording_link": "https://speaker-ver-api-td.s3-ap-southeast-2.amazonaws.com/enrollment.flac"
}
If this has been successful you should see in the response:
{
"success": true
}
Validating a recording
Send a POST request to http://localhost:8000/validate with the content:
{
"id": 123456789,
"recording_link": "https://speaker-ver-api-td.s3-ap-southeast-2.amazonaws.com/validation.flac"
}
If this has been successful you should see in the response:
{
"success": true,
"data": {
"score": 83.34
}
}