Automatic Speech Recognition
pyannote.audio
pyannote
pyannote-audio-pipeline
audio
voice
speech
speaker
speaker-diarization
speaker-change-detection
voice-activity-detection
overlapped-speech-detection
Instructions to use hicustomer/pyannote-speaker-diarization with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- pyannote.audio
How to use hicustomer/pyannote-speaker-diarization with pyannote.audio:
from pyannote.audio import Pipeline pipeline = Pipeline.from_pretrained("hicustomer/pyannote-speaker-diarization") # 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}) - Notebooks
- Google Colab
- Kaggle
Download handler_test.py from hicustomer/pyannote-speaker-diarization: direct link, hf CLI and curl.
- Browser
- Download file 197 Bytes
-
https://huggingface.co/hicustomer/pyannote-speaker-diarization/resolve/main/handler_test.py
- Command line
-
hf download hf://hicustomer/pyannote-speaker-diarization/handler_test.py
-
curl -L -o handler_test.py https://huggingface.co/hicustomer/pyannote-speaker-diarization/resolve/main/handler_test.py
197 Bytes
| from handler import EndpointHandler | |
| my_handler = EndpointHandler() | |
| with open("./handler_test.wav", "rb") as file: | |
| bytes_data = file.read() | |
| res = my_handler({"inputs": bytes_data}) | |
| print(res) | |