22 releases

0.3.0 Dec 13, 2024
0.3.0-beta.0 Nov 30, 2024
0.2.9 Nov 29, 2024
0.2.7 Aug 18, 2024
0.1.9 Aug 7, 2024

#206 in Machine learning

Download history 18/week @ 2024-09-17 28/week @ 2024-09-24 48/week @ 2024-10-01 50/week @ 2024-10-08 16/week @ 2024-10-15 2/week @ 2024-10-22 1/week @ 2024-10-29 39/week @ 2024-11-05 57/week @ 2024-11-12 18/week @ 2024-11-19 330/week @ 2024-11-26 61/week @ 2024-12-03 161/week @ 2024-12-10 13/week @ 2024-12-17

174 downloads per month

MIT license

16KB
232 lines

pyannote-rs

Crates License

Pyannote audio diarization in Rust

Features

  • Compute 1 hour of audio in less than a minute on CPU.
  • Faster performance with DirectML on Windows and CoreML on macOS.
  • Accurate timestamps with Pyannote segmentation.
  • Identify speakers with wespeaker embeddings.

Install

cargo add pyannote-rs

Usage

See Building

Examples

See examples

How it works

pyannote-rs uses 2 models for speaker diarization:

  1. Segmentation: segmentation-3.0 identifies when speech occurs.
  2. Speaker Identification: wespeaker-voxceleb-resnet34-LM identifies who is speaking.

Inference is powered by onnxruntime.

  • The segmentation model processes up to 10s of audio, using a sliding window approach (iterating in chunks).
  • The embedding model processes filter banks (audio features) extracted with knf-rs.

Speaker comparison (e.g., determining if Alice spoke again) is done using cosine similarity.

Credits

Big thanks to pyannote-onnx and kaldi-native-fbank

Dependencies

~3–10MB
~108K SLoC