#speaker #embedding #onnx-runtime #macos #diarization #pyannote

pyannote-rs

Speaker diarization using pyannote in Rust

19 releases

new 0.2.8 Nov 28, 2024
0.2.7 Aug 18, 2024
0.1.9 Aug 7, 2024

#369 in Audio

Download history 948/week @ 2024-08-05 378/week @ 2024-08-12 97/week @ 2024-08-19 47/week @ 2024-08-26 10/week @ 2024-09-02 33/week @ 2024-09-16 26/week @ 2024-09-23 49/week @ 2024-09-30 48/week @ 2024-10-07 21/week @ 2024-10-14 3/week @ 2024-10-21 1/week @ 2024-10-28 85/week @ 2024-11-11 28/week @ 2024-11-18

115 downloads per month

MIT license

16KB
230 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
~106K SLoC