CoolFace
Modelpublic

hicustomer/pyannote-speaker-diarization

sourceHugging Facemitupdated 3y agoView on Hugging Face
1likes38downloads
Model Card

๐ŸŽน Speaker diarization

Relies on pyannote.audio 2.1.1: see installation instructions.

TL;DR

python
# 1. visit hf.co/pyannote/speaker-diarization and accept user conditions
# 2. visit hf.co/pyannote/segmentation and accept user conditions
# 3. visit hf.co/settings/tokens to create an access token
# 4. instantiate pretrained speaker diarization pipeline
from pyannote.audio import Pipeline
pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization@2.1",
                                    use_auth_token="ACCESS_TOKEN_GOES_HERE")


# apply the pipeline to an audio file
diarization = pipeline("audio.wav")

# dump the diarization output to disk using RTTM format
with open("audio.rttm", "w") as rttm:
    diarization.write_rttm(rttm)

Advanced usage

In case the number of speakers is known in advance, one can use the num_speakers option:

python
diarization = pipeline("audio.wav", num_speakers=2)

One can also provide lower and/or upper bounds on the number of speakers using min_speakers and max_speakers options:

python
diarization = pipeline("audio.wav", min_speakers=2, max_speakers=5)

Benchmark

Real-time factor

Real-time factor is around 2.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 1.5 minutes to process a one hour conversation.

Accuracy

This pipeline is benchmarked on a growing collection of datasets.

Processing is fully automatic:

  • โ€”no manual voice activity detection (as is sometimes the case in the literature)
  • โ€”no manual number of speakers (though it is possible to provide it to the pipeline)
  • โ€”no fine-tuning of the internal models nor tuning of the pipeline hyper-parameters to each dataset

... with the least forgiving diarization error rate (DER) setup (named "Full" in this paper):

  • โ€”no forgiveness collar
  • โ€”evaluation of overlapped speech
Benchmark[DER%](. "Diarization error rate")[FA%](. "False alarm rate")[Miss%](. "Missed detection rate")[Conf%](. "Speaker confusion rate")Expected outputFile-level evaluation
AISHELL-414.095.173.275.65RTTMeval
Albayzin (*RTVE 2022*)25.605.586.8413.18RTTMeval
AliMeeting (*channel 1*)27.424.8414.008.58RTTMeval
AMI (*headset mix,* *only_words*)18.914.489.514.91RTTMeval
AMI (*array1, channel 1,* *only_words)*27.124.1117.785.23RTTMeval
CALLHOME (*part2*)32.376.3013.7212.35RTTMeval
DIHARD 3 (*Full*)26.9410.508.418.03RTTMeval
Ego4D *v1 (validation)*63.993.9144.4215.67RTTMeval
REPERE (*phase 2*)8.172.232.493.45RTTMeval
This American Life20.822.0311.896.90RTTMeval
VoxConverse (*v0.3*)11.244.422.883.94RTTMeval

Technical report

This report describes the main principles behind version 2.1 of pyannote.audio speaker diarization pipeline. It also provides recipes explaining how to adapt the pipeline to your own set of annotated data. In particular, those are applied to the above benchmark and consistently leads to significant performance improvement over the above out-of-the-box performance.

Support

For commercial enquiries and scientific consulting, please contact me. For technical questions and bug reports, please check pyannote.audio Github repository.

Citations

bibtex
@inproceedings{Bredin2021,
  Title = {{End-to-end speaker segmentation for overlap-aware resegmentation}},
  Author = {{Bredin}, Herv{\'e} and {Laurent}, Antoine},
  Booktitle = {Proc. Interspeech 2021},
  Address = {Brno, Czech Republic},
  Month = {August},
  Year = {2021},
}
bibtex
@inproceedings{Bredin2020,
  Title = {{pyannote.audio: neural building blocks for speaker diarization}},
  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},
  Booktitle = {ICASSP 2020, IEEE International Conference on Acoustics, Speech, and Signal Processing},
  Address = {Barcelona, Spain},
  Month = {May},
  Year = {2020},
}