From 1c8786ceb6bc3b04968e60094988db9a64a6ee5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20BREDIN?= Date: Tue, 16 Sep 2025 11:27:18 +0200 Subject: [PATCH] feat: switch to pyannote.core 6.0.1 --- README.md | 6 +++--- pyproject.toml | 2 +- src/pyannote/audio/pipelines/speaker_diarization.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 08c0e452..abb6a12c 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ with ProgressHook() as hook: output = pipeline("audio.wav", hook=hook) # runs locally # print the result -for turn, _, speaker in output.speaker_diarization.itertracks(yield_label=True): +for turn, speaker in output.speaker_diarization: print(f"start={turn.start:.1f}s stop={turn.end:.1f}s speaker_{speaker}") # start=0.2s stop=1.5s speaker_0 # start=1.8s stop=3.9s speaker_1 @@ -67,10 +67,10 @@ from pyannote.audio import Pipeline pipeline = Pipeline.from_pretrained( "pyannote/speaker-diarization-precision-2", token="PYANNOTEAI_API_KEY") -diarization = pipeline("audio.wav") # runs on pyannoteAI servers +output = pipeline("audio.wav") # runs on pyannoteAI servers # print the result -for turn, _, speaker in diarization.itertracks(yield_label=True): +for turn, speaker in output.speaker_diarization: print(f"start={turn.start:.1f}s stop={turn.end:.1f}s {speaker}") # start=0.2s stop=1.6s SPEAKER_00 # start=1.8s stop=4.0s SPEAKER_01 diff --git a/pyproject.toml b/pyproject.toml index d9d19590..b3227cb2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ dependencies = [ "opentelemetry-api==1.34.0", "opentelemetry-sdk==1.34.0", "opentelemetry-exporter-otlp==1.34.0", - "pyannote-core>=6.0.0", + "pyannote-core>=6.0.1", "pyannote-database>=6.0.0", "pyannote-metrics>=4.0.0", "pyannote-pipeline>=4.0.0", diff --git a/src/pyannote/audio/pipelines/speaker_diarization.py b/src/pyannote/audio/pipelines/speaker_diarization.py index e84533bb..3b80033d 100644 --- a/src/pyannote/audio/pipelines/speaker_diarization.py +++ b/src/pyannote/audio/pipelines/speaker_diarization.py @@ -171,7 +171,7 @@ class SpeakerDiarization(SpeakerDiarizationMixin, Pipeline): # print diarization >>> assert isinstance(output.speaker_diarization, pyannote.core.Annotation) - >>> for turn, _, speaker in output.speaker_diarization.itertracks(yield_label=True): + >>> for turn, speaker in output.speaker_diarization: ... print(f"start={turn.start:.1f}s stop={turn.end:.1f}s speaker_{speaker}") # get one speaker embedding per speaker