speakrs models
This repository stores the model artifacts used by speakrs, a fast Rust speaker diarization library.
With the default online feature, speakrs downloads the required files from
this repository on first use. The SDK currently pins revision
5d24ffee75f13fb061fa6d10944a64e2dc1d5e6f.
Contents
- ONNX segmentation and embedding artifacts for CPU, CUDA, and MIGraphX runs
- CoreML
.mlmodelcbundles for Apple-platform CoreML runs - PLDA and VBx parameter files used by the clustering pipeline
Usage
# macOS with CoreML
speakrs = { version = "0.5", features = ["coreml"] }
# NVIDIA GPU
speakrs = { version = "0.5", features = ["cuda"] }
# CPU only
speakrs = "0.5"
use speakrs::{ExecutionMode, OwnedDiarizationPipeline};
fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let mut pipeline = OwnedDiarizationPipeline::from_pretrained(ExecutionMode::CoreMl)?;
let audio: Vec<f32> = load_your_mono_16khz_audio_here();
let result = pipeline.run(&audio)?;
print!("{}", result.rttm("my-audio"));
Ok(())
}
For offline or airgapped setups, download this repository and set
SPEAKRS_MODELS_DIR to the local model directory.
Provenance
The artifacts are exported or converted for speakrs from the
pyannote community-1
pipeline and its segmentation and WeSpeaker components. PLDA and VBx parameters
are extracted from the pipeline cache. CoreML bundles are converted from the
exported model artifacts for Apple-platform execution.
Upstream model access may require accepting upstream terms. Users are responsible for complying with the licenses and terms of the upstream models and datasets.
Links
- GitHub: https://github.com/avencera/speakrs
- Crates.io: https://crates.io/crates/speakrs
- Documentation: https://docs.rs/speakrs/latest/speakrs/