Git Product home page Git Product logo

speaker-verification-api's Introduction

CodeQL Python Lint

Speaker Verification Django RESTful API

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.

Table of Contents

Tech stack

Running the project

Prerequisites

Setting up the project

  1. Clone the repository
$ git clone https://github.com/OnTrack-UG-Squad/speaker-verification-api.git
  1. Copy .env.dev.db.sample & .env.dev.sample files from sample_envs to project root. Remove .sample at the end of the file extensions.
$ cp sample_envs/.env.dev.db.sample .env.dev.db
$ cp sample_envs/.env.dev.sample .env.dev
  1. Fill the env files
  • Populate POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB in .env.dev.db (Choose any user name and password)
  • Copy these values to the corresponding fields in .env.dev: SQL_USER=POSTGRES_USER, SQL_DATABASE=POSTGRES_DB SQL_PASSWORD=POSTGRES_PASSWORD
  1. 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)'
  1. Run the Docker containers
$ docker-compose -f docker-compose.yml up -d --build
  1. The app is listening at http://localhost:8000
  • Open http://localhost:8000/redis-healthcheck: Check the Redis's health and the response would be Redis is connected successfully
  • Open http://localhost:8000/flower: Redirects to the Flower dashboard

The runtime output can be viewed via docker logs

API Documentation

API Description

  • Enrolling a user
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
  • Validating a recording
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

Example

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 
  }
}

speaker-verification-api's People

Contributors

namvnngu avatar notkurt avatar jiatengtao avatar kurt-deakin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.