Upload pyannote_segmentation-3.0_1.txt with huggingface_hub
Browse files
pyannote_segmentation-3.0_1.txt
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
```CODE:
|
| 2 |
+
from pyannote.audio import Model, Inference
|
| 3 |
+
|
| 4 |
+
model = Model.from_pretrained("pyannote/segmentation-3.0")
|
| 5 |
+
inference = Inference(model)
|
| 6 |
+
|
| 7 |
+
# inference on the whole file
|
| 8 |
+
inference("file.wav")
|
| 9 |
+
|
| 10 |
+
# inference on an excerpt
|
| 11 |
+
from pyannote.core import Segment
|
| 12 |
+
excerpt = Segment(start=2.0, end=5.0)
|
| 13 |
+
inference.crop("file.wav", excerpt)
|
| 14 |
+
```
|
| 15 |
+
|
| 16 |
+
ERROR:
|
| 17 |
+
Traceback (most recent call last):
|
| 18 |
+
File "/tmp/pyannote_segmentation-3.0_1tBkPRG.py", line 23, in <module>
|
| 19 |
+
from pyannote.audio import Model, Inference
|
| 20 |
+
ModuleNotFoundError: No module named 'pyannote'
|