File size: 2,530 Bytes
63dd946 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | # 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:
```bash
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
```bash
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
```bash
# 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).
|