Relies on pyannote.audio 2.0: see
installation instructions.
1# load the pipeline from Hugginface Hub
2from pyannote.audio import Pipeline
3pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization@2022.07")
4
5# apply the pipeline to an audio file
6diarization = pipeline("audio.wav")
7
8# dump the diarization output to disk using RTTM format
9with open("audio.rttm", "w") as rttm:
10 diarization.write_rttm(rttm)
If you feel adventurous, you can try and play with the various pipeline hyper-parameters.
For instance, one can use a more aggressive voice activity detection by increasing the value of segmentation_onset threshold:
1hparams = pipeline.parameters(instantiated=True)
2hparams["segmentation_onset"] += 0.1
3pipeline.instantiate(hparams)
Real-time factor is around 5% using one Nvidia Tesla V100 SXM2 GPU (for the neural inference part) and one Intel Cascade Lake 6248 CPU (for the clustering part).
In other words, it takes approximately 3 minutes to process a one hour conversation.
This pipeline is benchmarked on a growing collection of datasets.
... with the least forgiving diarization error rate (DER) setup (named
"Full" in
this paper):
For commercial enquiries and scientific consulting, please contact
me.
For
technical questions and
bug reports, please check
pyannote.audio Github repository.
1@inproceedings{Bredin2021,
2 Title = {{End-to-end speaker segmentation for overlap-aware resegmentation}},
3 Author = {{Bredin}, Herv{\'e} and {Laurent}, Antoine},
4 Booktitle = {Proc. Interspeech 2021},
5 Address = {Brno, Czech Republic},
6 Month = {August},
7 Year = {2021},
8}
1@inproceedings{Bredin2020,
2 Title = {{pyannote.audio: neural building blocks for speaker diarization}},
3 Author = {{Bredin}, Herv{\'e} and {Yin}, Ruiqing and {Coria}, Juan Manuel and {Gelly}, Gregory and {Korshunov}, Pavel and {Lavechin}, Marvin and {Fustes}, Diego and {Titeux}, Hadrien and {Bouaziz}, Wassim and {Gill}, Marie-Philippe},
4 Booktitle = {ICASSP 2020, IEEE International Conference on Acoustics, Speech, and Signal Processing},
5 Address = {Barcelona, Spain},
6 Month = {May},
7 Year = {2020},
8}