Latest
Collection
Compatible with pyannote.audio 4.x β’ 4 items β’ Updated β’ 4
How to use pyannote/speaker-diarization-precision-2 with pyannote.audio:
from pyannote.audio import Pipeline
pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization-precision-2")
# inference on the whole file
pipeline("file.wav")
# inference on an excerpt
from pyannote.core import Segment
excerpt = Segment(start=2.0, end=5.0)
from pyannote.audio import Audio
waveform, sample_rate = Audio().crop("file.wav", excerpt)
pipeline({"waveform": waveform, "sample_rate": sample_rate})Precision-2 speaker diarization
This pipeline runs Precision-2 speaker diarization on pyannoteAI cloud.
Read the announcement blog post.
This pipeline is a stripped down version of pyannoteAI SDK that provides much more features:
A self-hosted version of Precision-2 is also available for enterprise customers.
pip install pyannote.audiopyannoteAI dashboard (free credits included)# initialize speaker diarization pipeline
from pyannote.audio import Pipeline
pipeline = Pipeline.from_pretrained(
'pyannote/speaker-diarization-precision-2',
token="{pyannoteAI-api-key}")
# run speaker diarization on pyannoteAI cloud
output = pipeline("/path/to/audio.wav")
# enjoy state-of-the-art speaker diarization
for turn, speaker in output.speaker_diarization:
print(f"start={turn.start:.1f}s stop={turn.end:.1f}s speaker_{speaker}")