Skip to main content

A simple speaker recognition library in JAX and Flax.

Project description

FlaxSpeaker

Python application PyPI Version Python Versions Downloads

Overview

A simple speaker recognition library in JAX and Flax.

For the PyTorch version, see: SpeakerRecognitionFromScratch

Installation

pip install flaxspeaker

Tutorial

Experiment config

All your experiment configurations are represented in a single YAML file.

See myconfig.yml as an example.

Hook up with data

In the configuration file, you need to correctly hook it up with your downloaded dataset.

For example, if you have downloaded LibriSpeech on your own machine, you need to set these two fields correctly:

data:
  train_librispeech_dir: "YOUR LIBRISPEECH TRAINING SET PATH"
  test_librispeech_dir: "YOUR LIBRISPEECH TESTING SET PATH"

If you are using a different dataset than LibriSpeech, you need to represent your dataset as CSV files. Then set these two fields correctly:

data:
  train_csv: "YOUR TRAINING SET CSV"
  test_csv: "YOUR TESTING SET CSV"

Generate dataset CSV

To represent your downloaded datasets by CSV files, you can use the generate_csv mode for the flaxspeaker command.

For example, you can use a command like below to generate a CSV file CN-Celeb.csv to represent your downloaded CN-Celeb dataset located at "${HOME}/Downloads/CN-Celeb_flac/data":

python -m flaxspeaker \
--mode generate_csv \
--path_to_dataset "${HOME}/Downloads/CN-Celeb_flac/data" \
--audio_format ".flac" \
--speaker_label_index -2 \
--output_csv "CN-Celeb.csv"

You can use --help to understand the meaning of each flag:

python -m flaxspeaker --help

Training

Once you have the config file ready (e.g. your_config.yml), you can launch your training with this command:

python -m flaxspeaker --mode train --config your_config.yml

Evaluation

After you finished training, you can evaluate the Equal Error Rate (EER) of the model you just trained with:

python -m flaxspeaker --mode eval --config your_config.yml

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flaxspeaker-0.0.2.tar.gz (13.9 kB view hashes)

Uploaded Source

Built Distribution

flaxspeaker-0.0.2-py3-none-any.whl (15.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page