| tags: | |
| - pyannote | |
| - pyannote-audio | |
| - pyannote-audio-pipeline | |
| - audio | |
| - voice | |
| - speech | |
| - speaker | |
| - speaker-diarization | |
| - speaker-change-detection | |
| - voice-activity-detection | |
| - overlapped-speech-detection | |
| # Hosted `Community-1` speaker diarization | |
| This pipeline runs [`Community-1`](https://hf.co/pyannote/speaker-diarization-community-1) speaker diarization on [pyannoteAI](https://www.pyannote.ai) cloud. | |
| Read the announcement [blog post](https://www.pyannote.ai/blog/community-1). | |
| ## Setup | |
| 1. `pip install pyannote.audio` | |
| 2. Create an API key on [`pyannoteAI` dashboard](https://dashboard.pyannote.ai) (free credits included) | |
| ## Usage | |
| ```python | |
| # initialize speaker diarization pipeline | |
| from pyannote.audio import Pipeline | |
| pipeline = Pipeline.from_pretrained( | |
| 'pyannote/speaker-diarization-community-1-cloud', | |
| token="{pyannoteAI-api-key}") | |
| # run speaker diarization on pyannoteAI cloud | |
| output = pipeline("/path/to/audio.wav") | |
| # print speaker diarization | |
| for turn, speaker in output.speaker_diarization: | |
| print(f"start={turn.start:.1f}s stop={turn.end:.1f}s speaker_{speaker}") | |
| ``` | |