StephennFernandes's picture
Anuvani-Diarization 1.0.0
63dd946
|
Raw History Blame Contribute Delete
2.53 kB

The original Python program of Anuvani-Diarization 1.0

diarize.py and its package anuvani_diar_ref/ are the program the release's published results come from:

  • the DiariZen segmentation network and the WeSpeaker voiceprint network on PyTorch;
  • then cannot-link VBx clustering and the learned decoder.

The pip package anuvani_diar (../README.md) runs the same pipeline on a Rust engine and gives the same bytes on the setup the release's outputs were produced with. Use the package unless you need this exact code.

Setting it up

Linux, an NVIDIA GPU, Python 3.10:

pip install torch==2.1.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cu121
git clone https://github.com/BUTSpeechFIT/DiariZen && cd DiariZen && git checkout 844f555
pip install -c constraints.txt -e . && pip install -e pyannote-audio && cd ..
pip install -r requirements.txt

requirements.txt lists these steps. env/pip_freeze_reference.txt is the full environment the outputs were verified in (PyTorch 2.1.1 with CUDA 12.1). The program does not run in Google Colab, which cannot install PyTorch 2.1.1.

Running it

python diarize.py --out out/ meeting.wav
python diarize.py --out out/ --in-dir recordings/
# the CPU works too, about 3× slower than real time
python diarize.py --device cpu --out out/ call.flac
  • Each run writes run.json, with the weights' file hashes, the settings and an RTTM hash per file.
  • If another pyannote.audio is installed in your user site-packages, run Python with -s, so that DiariZen's fork is the one imported.

Install check

# the 12 recordings in ../golden/audio; expect "12/12 outputs identical"
python tools/verify_golden.py

A FAIL with matching audio usually means a different library version, GPU model, or non-default --batch-size or --threads.

Files

Path What
diarize.py, anuvani_diar_ref/ the program
bundle/ the weights as this program loads them (PyTorch checkpoints), the PLDA model and the decoder; MANIFEST.json lists every file's sha256
golden/expected.json the fingerprints of the 12 check recordings and of their RTTMs
tools/verify_golden.py the install check
requirements.txt, env/ the environment

The code is licensed under MIT OR Apache-2.0 (../LICENSE-MIT, ../LICENSE-APACHE). The weights in bundle/ are the same as those in ../model/: CC BY-NC 4.0 (the segmentation network) and CC BY 4.0 (the PLDA model and the voiceprint network).