Package: hyperion-ml
HYPERIONHyperion 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, CORALSeveral flavours of PLDA back-ends: Full-rank PLDA, Simplified PLDA, PLDACalibration and Fusion toolsRecipes for popular datasets: VoxCeleb, NIST-SRE, VOiCESThe full API is described in the documentation pagehttps://hyperion-ml.readthedocs.ioInstallation InstructionsPrerequisitesWe 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 and install PyTorch>=1.9, (older versions are not supported any longer) e.g.:conda create --name ${your_env} python=3.8
conda activate ${your_env}
conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=10.2 -c pytorchInstalling HyperionFirst, clone the repo:gitclonehttps://github.com/hyperion-ml/hyperion.gitYou can choose to install hyperion in the environmentcdhyperion
pipinstall-e.Or add the hyperion toolkit to the PYTHONPATH envirnoment variable
This option will allow you to share the same environment if you are working with several hyperion branches
at the same time, while installing it requires to have an enviroment per branch.
For this, you need to install the requirementscdhyperion
pipinstall-rrequirements.txtThen add these lines to your~/.bashrcor to each script that uses hyperionHYP_ROOT=#substitute this by your hyperion locationexportPYTHONPATH=${HYP_ROOT}:$PYTHONPATHexportPATH=${HYP_ROOT}/bin:$PATHRecipesThere are recipes for several tasks in the./egsdirectory.Prerequistes to run the recipesThese recipes require some extra tools (e.g. sph2pipe), which need to be installed first:./install_egs_requirements.shMost 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./toolsto your kaldi installationcdtools
ln-s${your_kaldi_path}kaldicd-Finally configure the python and environment name that you intend to use to run the recipes.
For that run./prepare_egs_paths.shThis 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 filetools/path.shwhich 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 structureThe structure of the recipes is very similar to Kaldi, so if should be
familiar for most people.
Data preparation is also similar to Kaldi. Each dataset has
a directory with files likewav.scp
utt2spk
spk2utt
...Running the recipesContrary to other toolkits, the recipes do not contain a singlerun.shscript
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.shwill evaluate the recipe with the default configuration.
The default configuration is in the filedefault_config.shWe also include extra configurations, which may change
the hyperparamters of the recipe. For example:Acoustic featuresType of the x-vector neural netwokHyper-parameters of the modelsetc.Extra configs are in theglobal_confdirectory of the recipe.
Then you can run the recipe with the alternate config as:run_001_prepare_data.sh--config-fileglobal_conf/alternative_conf.sh
run_002_compute_vad.sh--config-fileglobal_conf/alternative_conf.sh
run_010_prepare_audios_to_train_xvector.sh--config-fileglobal_conf/alternative_conf.sh
run_011_train_xvector.sh--config-fileglobal_conf/alternative_conf.sh
run_030_extract_xvectors.sh--config-fileglobal_conf/alternative_conf.sh
run_040_evaluate_plda_backend.sh--config-fileglobal_conf/alternative_conf.shNote 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.CitingEach recipe README.md file contains the bibtex to the works that should be cited if you
use that recipe in your researchDirectory structure:The directory structure of the repo looks like this:hyperion
hyperion/egs
hyperion/hyperion
hyperion/resources
hyperion/tests
hyperion/toolsDirectories:hyperion: python classes with utilities for speaker and language recognitionegs: 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 hyperionresources: data files required by unittest or recipes