Using this open-source model in production?
Consider switching to
pyannoteAI for better and faster options.
This pipeline is the same as
pyannote/speaker-diarization-3.0 except it removes the
problematic use of
onnxruntime.
Both speaker segmentation and embedding now run in pure PyTorch. This should ease deployment and possibly speed up inference.
It requires pyannote.audio version 3.1 or higher.
It ingests mono audio sampled at 16kHz and outputs speaker diarization as an
Annotation instance:
1# instantiate the pipeline
2from pyannote.audio import Pipeline
3pipeline = Pipeline.from_pretrained(
4 "pyannote/speaker-diarization-3.1",
5 use_auth_token="HUGGINGFACE_ACCESS_TOKEN_GOES_HERE")
6
7# run the pipeline on an audio file
8diarization = pipeline("audio.wav")
9
10# dump the diarization output to disk using RTTM format
11with open("audio.rttm", "w") as rttm:
12 diarization.write_rttm(rttm)
1import torch
2pipeline.to(torch.device("cuda"))
1waveform, sample_rate = torchaudio.load("audio.wav")
2diarization = pipeline({"waveform": waveform, "sample_rate": sample_rate})
1from pyannote.audio.pipelines.utils.hook import ProgressHook
2with ProgressHook() as hook:
3 diarization = pipeline("audio.wav", hook=hook)
This pipeline has been benchmarked on a large collection of datasets.
... with the least forgiving diarization error rate (DER) setup (named
"Full" in
this paper):
1@inproceedings{Plaquet23,
2 author={Alexis Plaquet and Hervé Bredin},
3 title={{Powerset multi-class cross entropy loss for neural speaker diarization}},
4 year=2023,
5 booktitle={Proc. INTERSPEECH 2023},
6}
1@inproceedings{Bredin23,
2 author={Hervé Bredin},
3 title={{pyannote.audio 2.1 speaker diarization pipeline: principle, benchmark, and recipe}},
4 year=2023,
5 booktitle={Proc. INTERSPEECH 2023},
6}