Add model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- speaker-diarization
|
| 4 |
+
- speech-diarization
|
| 5 |
+
- audio
|
| 6 |
+
- onnx
|
| 7 |
+
- coreml
|
| 8 |
+
- rust
|
| 9 |
+
- speakrs
|
| 10 |
+
library_name: speakrs
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# speakrs models
|
| 14 |
+
|
| 15 |
+
This repository stores the model artifacts used by
|
| 16 |
+
[speakrs](https://github.com/avencera/speakrs), a fast Rust speaker
|
| 17 |
+
diarization library.
|
| 18 |
+
|
| 19 |
+
With the default `online` feature, `speakrs` downloads the required files from
|
| 20 |
+
this repository on first use. The SDK currently pins revision
|
| 21 |
+
`5d24ffee75f13fb061fa6d10944a64e2dc1d5e6f`.
|
| 22 |
+
|
| 23 |
+
## Contents
|
| 24 |
+
|
| 25 |
+
- ONNX segmentation and embedding artifacts for CPU, CUDA, and MIGraphX runs
|
| 26 |
+
- CoreML `.mlmodelc` bundles for Apple-platform CoreML runs
|
| 27 |
+
- PLDA and VBx parameter files used by the clustering pipeline
|
| 28 |
+
|
| 29 |
+
## Usage
|
| 30 |
+
|
| 31 |
+
```toml
|
| 32 |
+
# macOS with CoreML
|
| 33 |
+
speakrs = { version = "0.5", features = ["coreml"] }
|
| 34 |
+
|
| 35 |
+
# NVIDIA GPU
|
| 36 |
+
speakrs = { version = "0.5", features = ["cuda"] }
|
| 37 |
+
|
| 38 |
+
# CPU only
|
| 39 |
+
speakrs = "0.5"
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
```rust
|
| 43 |
+
use speakrs::{ExecutionMode, OwnedDiarizationPipeline};
|
| 44 |
+
|
| 45 |
+
fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
| 46 |
+
let mut pipeline = OwnedDiarizationPipeline::from_pretrained(ExecutionMode::CoreMl)?;
|
| 47 |
+
|
| 48 |
+
let audio: Vec<f32> = load_your_mono_16khz_audio_here();
|
| 49 |
+
let result = pipeline.run(&audio)?;
|
| 50 |
+
|
| 51 |
+
print!("{}", result.rttm("my-audio"));
|
| 52 |
+
Ok(())
|
| 53 |
+
}
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
For offline or airgapped setups, download this repository and set
|
| 57 |
+
`SPEAKRS_MODELS_DIR` to the local model directory.
|
| 58 |
+
|
| 59 |
+
## Provenance
|
| 60 |
+
|
| 61 |
+
The artifacts are exported or converted for `speakrs` from the
|
| 62 |
+
[pyannote community-1](https://huggingface.co/pyannote/speaker-diarization-community-1)
|
| 63 |
+
pipeline and its segmentation and WeSpeaker components. PLDA and VBx parameters
|
| 64 |
+
are extracted from the pipeline cache. CoreML bundles are converted from the
|
| 65 |
+
exported model artifacts for Apple-platform execution.
|
| 66 |
+
|
| 67 |
+
Upstream model access may require accepting upstream terms. Users are
|
| 68 |
+
responsible for complying with the licenses and terms of the upstream models
|
| 69 |
+
and datasets.
|
| 70 |
+
|
| 71 |
+
## Links
|
| 72 |
+
|
| 73 |
+
- GitHub: https://github.com/avencera/speakrs
|
| 74 |
+
- Crates.io: https://crates.io/crates/speakrs
|
| 75 |
+
- Documentation: https://docs.rs/speakrs/latest/speakrs/
|