This release is a pre-release and may not be stable for production use.
HYPERION
Hyperion is a Speaker Recognition Toolkit based on PyTorch and numpy. It provides:
- x-Vector architectures: ResNet, Res2Net, Spine2Net, ECAPA-TDNN, EfficientNet, Transformers and others.
- Embedding preprocessing tools: PCA, LDA, NAP, Centering/Whitening, Length Normalization, CORAL
- Several flavours of PLDA back-ends: Full-rank PLDA, Simplified PLDA, PLDA
- Calibration and Fusion tools
- Recipes for popular datasets: VoxCeleb, NIST-SRE, VOiCES
The full API is described in the documentation page https://hyperion-ml.readthedocs.io
Building the documentation
Install the documentation dependencies and run the repository build script:
python3 -m pip install -r docs/requirements.txt
./docs/build.sh
The generated site is at docs/_build/html/index.html. The script treats
documentation warnings as errors. See the
documentation build guide for link checking,
doctests, and cleanup commands.
Installation Instructions
Prerequisites
We use anaconda or miniconda, though you should be able to make it work in other python distributions
To start, you should create a new enviroment:
conda create --name ${your_env} python=3.11
conda activate ${your_env}
Installing Hyperion
- First, clone the repo:
git clone https://github.com/hyperion-ml/hyperion.git
- Then install hyperion in the environment, these are some valid commands depending pytorch and cuda versions:
cd hyperion
pip install --extra-index-url https://download.pytorch.org/whl/cu130 -e .[torch29]
pip install --extra-index-url https://download.pytorch.org/whl/cu128 -e .[torch29]
pip install --extra-index-url https://download.pytorch.org/whl/cu126 -e .[torch29]
pip install --extra-index-url https://download.pytorch.org/whl/cu129 -e .[torch28]
pip install --extra-index-url https://download.pytorch.org/whl/cu128 -e .[torch28]
pip install --extra-index-url https://download.pytorch.org/whl/cu126 -e .[torch28]
pip install --extra-index-url https://download.pytorch.org/whl/cu128 -e .[torch27]
pip install --extra-index-url https://download.pytorch.org/whl/cu126 -e .[torch27]
pip install --extra-index-url https://download.pytorch.org/whl/cu124 -e .[torch26]
pip install --extra-index-url https://download.pytorch.org/whl/cu121 -e .[torch25]
pip install --extra-index-url https://download.pytorch.org/whl/cu121 -e .[torch24]
Known issues:
For older linux systems with GLIB <=2.17, try something like
pip install --extra-index-url https://download.pytorch.org/whl/cu121 -e .[torch25,gcc217] --only-binary=:all: --no-binary=intervaltree,fairscale
If you get this error when training:
Error: mkl-service + Intel(R) MKL: MKL_THREADING_LAYER=INTEL is incompatible with libgomp.so.1 library.
Try to import numpy first or set the threading layer accordingly. Set MKL_SERVICE_FORCE_INTEL to force it.
Unistall and reinstall numpy:
pip unistall numpy
pip install numpy=={same-version-you-uninstalled}
Recipes
There are recipes for several tasks in the ./egs directory.
Prerequistes to run the recipes
These recipes require some extra tools (e.g. sph2pipe), which need to be installed first:
./install_egs_requirements.sh
Most recipes do not require Kaldi, only the older ones using Kaldi x-vectors,
so we do not install it by default. If you are going to need it install it
yourself. Then make a link in ./tools to your kaldi installation
cd tools
ln -s ${your_kaldi_path} kaldi
cd -
Finally configure the python and environment name that you intend to use to run the recipes. For that run
./prepare_egs_paths.sh
This script will ask for the path to your anaconda installation and enviromentment name. It will also detect if hyperion is already installed in the environment, otherwise it will add hyperion to your python path. This will create the file
tools/path.sh
which sets all the enviroment variables required to run the recipes. This has been tested only on JHU computer grids, so you may need to modify this file manually to adapt it to your grid.
Recipes structure
The recipe layout is inspired by Kaldi: each dataset is prepared in a
directory under data/, and the numbered run_*.sh scripts operate on those
prepared datasets. However, the maintained recipes generally use Hyperion's
HyperDataset format rather than a collection of Kaldi mapping files. A
typical prepared dataset contains a manifest describing the available tables:
dataset.yaml
segments.csv # segment IDs, recordings, speakers, timing, and metadata
recordings.csv # recording IDs and audio storage paths
speaker.csv # optional class/speaker information
trials.csv # optional enrollment/test trial definitions
Some older recipes still use Kaldi-style data directories, with files such as
wav.scp, utt2spk, and spk2utt. Those layouts remain supported where the
recipe expects them, but they are not the standard output of the current
dataset-preparation classes.
Running the recipes
Contrary to other toolkits, the recipes do not contain a single run.sh script
to run all the steps of the recipe.
Since some recipes have many steps and most times you don't want to run all of then
from the beginning, we have split the recipe in several run scripts.
The scripts have a number indicating the order in the sequence.
For example,
run_001_prepare_data.sh
run_002_compute_vad.sh
run_010_prepare_audios_to_train_xvector.sh
run_011_train_xvector.sh
run_030_extract_xvectors.sh
run_040_evaluate_plda_backend.sh
will evaluate the recipe with the default configuration.
The default configuration is in the file default_config.sh
We also include extra configurations, which may change the hyperparamters of the recipe. For example:
- Acoustic features
- Type of the x-vector neural netwok
- Hyper-parameters of the models
- etc.
Extra configs are in the global_conf directory of the recipe.
Then you can run the recipe with the alternate config as:
run_001_prepare_data.sh --config-file global_conf/alternative_conf.sh
run_002_compute_vad.sh --config-file global_conf/alternative_conf.sh
run_010_prepare_audios_to_train_xvector.sh --config-file global_conf/alternative_conf.sh
run_011_train_xvector.sh --config-file global_conf/alternative_conf.sh
run_030_extract_xvectors.sh --config-file global_conf/alternative_conf.sh
run_040_evaluate_plda_backend.sh --config-file global_conf/alternative_conf.sh
Note that many alternative configus share hyperparameters with the default configs. That means that you may not need to rerun all the steps to evaluate a new configuration. It mast cases you just need to re-run the steps from the neural network training to the end.
Citing
Each recipe README.md file contains the bibtex to the works that should be cited if you use that recipe in your research
Directory structure:
- The directory structure of the repo looks like this:
hyperion
hyperion/egs
hyperion/hyperion
hyperion/resources
hyperion/tests
hyperion/tools
- Directories:
- hyperion: python classes with utilities for speaker and language recognition
- egs: recipes for sevaral tasks: VoxCeleb, SRE18/19/20, voices, ...
- tools: contains external repos and tools like kaldi, python, cudnn, etc.
- tests: unit tests for the classes in hyperion
- resources: data files required by unittest or recipes
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hyperion_ml-0.4.1a0.tar.gz.
File metadata
- Download URL: hyperion_ml-0.4.1a0.tar.gz
- Upload date:
- Size: 7.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e90e87a283ccbc6b75c1795f930fce54a9fdf924de23325a97ad7a7ffa56a398
|
|
| MD5 |
f4e6db64f57b2e690d1d0945d8e5c5ae
|
|
| BLAKE2b-256 |
f9c5d29073e9b63404211ec632ae4ea21ef09d8b8ef483d67c52043c7f7dcf58
|
Provenance
The following attestation bundles were made for hyperion_ml-0.4.1a0.tar.gz:
Publisher:
python-publish.yml on hyperion-ml/hyperion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hyperion_ml-0.4.1a0.tar.gz -
Subject digest:
e90e87a283ccbc6b75c1795f930fce54a9fdf924de23325a97ad7a7ffa56a398 - Sigstore transparency entry: 2567453334
- Sigstore integration time:
-
Permalink:
hyperion-ml/hyperion@86c346aaed0a994d36b74a3e5600590ae9e168e4 -
Branch / Tag:
refs/tags/v0.4.1.a - Owner: https://github.com/hyperion-ml
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@86c346aaed0a994d36b74a3e5600590ae9e168e4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file hyperion_ml-0.4.1a0-py3-none-any.whl.
File metadata
- Download URL: hyperion_ml-0.4.1a0-py3-none-any.whl
- Upload date:
- Size: 9.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
275e8852630ffd0998f43f023d208d0199e1af75fbd66d981ec6d339ca4c0fcd
|
|
| MD5 |
0657d5f4a957462307459ba8bedb22c2
|
|
| BLAKE2b-256 |
dd2023c00e6b611c8efc6a6d4a1c20eaa0e0cadc6872c063054fda6e88414c8f
|
Provenance
The following attestation bundles were made for hyperion_ml-0.4.1a0-py3-none-any.whl:
Publisher:
python-publish.yml on hyperion-ml/hyperion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hyperion_ml-0.4.1a0-py3-none-any.whl -
Subject digest:
275e8852630ffd0998f43f023d208d0199e1af75fbd66d981ec6d339ca4c0fcd - Sigstore transparency entry: 2567453559
- Sigstore integration time:
-
Permalink:
hyperion-ml/hyperion@86c346aaed0a994d36b74a3e5600590ae9e168e4 -
Branch / Tag:
refs/tags/v0.4.1.a - Owner: https://github.com/hyperion-ml
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@86c346aaed0a994d36b74a3e5600590ae9e168e4 -
Trigger Event:
release
-
Statement type: