Upload 6 files
Browse files- LICENSE +21 -0
- README.md +144 -0
- config.yaml +16 -0
- example.png +0 -0
- gitattributes +16 -0
- pytorch_model.bin +3 -0
LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
|
3 |
+
Copyright (c) 2022 CNRS
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
+
SOFTWARE.
|
README.md
ADDED
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- pyannote
|
4 |
+
- pyannote-audio
|
5 |
+
- pyannote-audio-model
|
6 |
+
- audio
|
7 |
+
- voice
|
8 |
+
- speech
|
9 |
+
- speaker
|
10 |
+
- speaker-segmentation
|
11 |
+
- voice-activity-detection
|
12 |
+
- overlapped-speech-detection
|
13 |
+
- resegmentation
|
14 |
+
license: mit
|
15 |
+
inference: false
|
16 |
+
extra_gated_prompt: "The collected information will help acquire a better knowledge of pyannote.audio userbase and help its maintainers apply for grants to improve it further. If you are an academic researcher, please cite the relevant papers in your own publications using the model. If you work for a company, please consider contributing back to pyannote.audio development (e.g. through unrestricted gifts). We also provide scientific consulting services around speaker diarization and machine listening."
|
17 |
+
extra_gated_fields:
|
18 |
+
Company/university: text
|
19 |
+
Website: text
|
20 |
+
I plan to use this model for (task, type of audio data, etc): text
|
21 |
+
---
|
22 |
+
|
23 |
+
Using this open-source model in production?
|
24 |
+
Consider switching to [pyannoteAI](https://www.pyannote.ai) for better and faster options.
|
25 |
+
|
26 |
+
|
27 |
+
# 🎹 Speaker segmentation
|
28 |
+
|
29 |
+
[Paper](http://arxiv.org/abs/2104.04045) | [Demo](https://huggingface.co/spaces/pyannote/pretrained-pipelines) | [Blog post](https://herve.niderb.fr/fastpages/2022/10/23/One-speaker-segmentation-model-to-rule-them-all)
|
30 |
+
|
31 |
+

|
32 |
+
|
33 |
+
## Usage
|
34 |
+
|
35 |
+
Relies on pyannote.audio 2.1.1: see [installation instructions](https://github.com/pyannote/pyannote-audio).
|
36 |
+
|
37 |
+
```python
|
38 |
+
# 1. visit hf.co/pyannote/segmentation and accept user conditions
|
39 |
+
# 2. visit hf.co/settings/tokens to create an access token
|
40 |
+
# 3. instantiate pretrained model
|
41 |
+
from pyannote.audio import Model
|
42 |
+
model = Model.from_pretrained("pyannote/segmentation",
|
43 |
+
use_auth_token="ACCESS_TOKEN_GOES_HERE")
|
44 |
+
```
|
45 |
+
|
46 |
+
### Voice activity detection
|
47 |
+
|
48 |
+
```python
|
49 |
+
from pyannote.audio.pipelines import VoiceActivityDetection
|
50 |
+
pipeline = VoiceActivityDetection(segmentation=model)
|
51 |
+
HYPER_PARAMETERS = {
|
52 |
+
# onset/offset activation thresholds
|
53 |
+
"onset": 0.5, "offset": 0.5,
|
54 |
+
# remove speech regions shorter than that many seconds.
|
55 |
+
"min_duration_on": 0.0,
|
56 |
+
# fill non-speech regions shorter than that many seconds.
|
57 |
+
"min_duration_off": 0.0
|
58 |
+
}
|
59 |
+
pipeline.instantiate(HYPER_PARAMETERS)
|
60 |
+
vad = pipeline("audio.wav")
|
61 |
+
# `vad` is a pyannote.core.Annotation instance containing speech regions
|
62 |
+
```
|
63 |
+
|
64 |
+
### Overlapped speech detection
|
65 |
+
|
66 |
+
```python
|
67 |
+
from pyannote.audio.pipelines import OverlappedSpeechDetection
|
68 |
+
pipeline = OverlappedSpeechDetection(segmentation=model)
|
69 |
+
pipeline.instantiate(HYPER_PARAMETERS)
|
70 |
+
osd = pipeline("audio.wav")
|
71 |
+
# `osd` is a pyannote.core.Annotation instance containing overlapped speech regions
|
72 |
+
```
|
73 |
+
|
74 |
+
### Resegmentation
|
75 |
+
|
76 |
+
```python
|
77 |
+
from pyannote.audio.pipelines import Resegmentation
|
78 |
+
pipeline = Resegmentation(segmentation=model,
|
79 |
+
diarization="baseline")
|
80 |
+
pipeline.instantiate(HYPER_PARAMETERS)
|
81 |
+
resegmented_baseline = pipeline({"audio": "audio.wav", "baseline": baseline})
|
82 |
+
# where `baseline` should be provided as a pyannote.core.Annotation instance
|
83 |
+
```
|
84 |
+
|
85 |
+
### Raw scores
|
86 |
+
|
87 |
+
```python
|
88 |
+
from pyannote.audio import Inference
|
89 |
+
inference = Inference(model)
|
90 |
+
segmentation = inference("audio.wav")
|
91 |
+
# `segmentation` is a pyannote.core.SlidingWindowFeature
|
92 |
+
# instance containing raw segmentation scores like the
|
93 |
+
# one pictured above (output)
|
94 |
+
```
|
95 |
+
|
96 |
+
|
97 |
+
## Citation
|
98 |
+
|
99 |
+
```bibtex
|
100 |
+
@inproceedings{Bredin2021,
|
101 |
+
Title = {{End-to-end speaker segmentation for overlap-aware resegmentation}},
|
102 |
+
Author = {{Bredin}, Herv{\'e} and {Laurent}, Antoine},
|
103 |
+
Booktitle = {Proc. Interspeech 2021},
|
104 |
+
Address = {Brno, Czech Republic},
|
105 |
+
Month = {August},
|
106 |
+
Year = {2021},
|
107 |
+
```
|
108 |
+
|
109 |
+
```bibtex
|
110 |
+
@inproceedings{Bredin2020,
|
111 |
+
Title = {{pyannote.audio: neural building blocks for speaker diarization}},
|
112 |
+
Author = {{Bredin}, Herv{\'e} and {Yin}, Ruiqing and {Coria}, Juan Manuel and {Gelly}, Gregory and {Korshunov}, Pavel and {Lavechin}, Marvin and {Fustes}, Diego and {Titeux}, Hadrien and {Bouaziz}, Wassim and {Gill}, Marie-Philippe},
|
113 |
+
Booktitle = {ICASSP 2020, IEEE International Conference on Acoustics, Speech, and Signal Processing},
|
114 |
+
Address = {Barcelona, Spain},
|
115 |
+
Month = {May},
|
116 |
+
Year = {2020},
|
117 |
+
}
|
118 |
+
```
|
119 |
+
|
120 |
+
## Reproducible research
|
121 |
+
|
122 |
+
In order to reproduce the results of the paper ["End-to-end speaker segmentation for overlap-aware resegmentation
|
123 |
+
"](https://arxiv.org/abs/2104.04045), use `pyannote/segmentation@Interspeech2021` with the following hyper-parameters:
|
124 |
+
|
125 |
+
| Voice activity detection | `onset` | `offset` | `min_duration_on` | `min_duration_off` |
|
126 |
+
| ------------------------ | ------- | -------- | ----------------- | ------------------ |
|
127 |
+
| AMI Mix-Headset | 0.684 | 0.577 | 0.181 | 0.037 |
|
128 |
+
| DIHARD3 | 0.767 | 0.377 | 0.136 | 0.067 |
|
129 |
+
| VoxConverse | 0.767 | 0.713 | 0.182 | 0.501 |
|
130 |
+
|
131 |
+
| Overlapped speech detection | `onset` | `offset` | `min_duration_on` | `min_duration_off` |
|
132 |
+
| --------------------------- | ------- | -------- | ----------------- | ------------------ |
|
133 |
+
| AMI Mix-Headset | 0.448 | 0.362 | 0.116 | 0.187 |
|
134 |
+
| DIHARD3 | 0.430 | 0.320 | 0.091 | 0.144 |
|
135 |
+
| VoxConverse | 0.587 | 0.426 | 0.337 | 0.112 |
|
136 |
+
|
137 |
+
| Resegmentation of VBx | `onset` | `offset` | `min_duration_on` | `min_duration_off` |
|
138 |
+
| --------------------- | ------- | -------- | ----------------- | ------------------ |
|
139 |
+
| AMI Mix-Headset | 0.542 | 0.527 | 0.044 | 0.705 |
|
140 |
+
| DIHARD3 | 0.592 | 0.489 | 0.163 | 0.182 |
|
141 |
+
| VoxConverse | 0.537 | 0.724 | 0.410 | 0.563 |
|
142 |
+
|
143 |
+
Expected outputs (and VBx baseline) are also provided in the `/reproducible_research` sub-directories.
|
144 |
+
|
config.yaml
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
task:
|
2 |
+
_target_: pyannote.audio.tasks.Segmentation
|
3 |
+
duration: 5.0
|
4 |
+
max_num_speakers: 3
|
5 |
+
model:
|
6 |
+
_target_: pyannote.audio.models.segmentation.PyanNet
|
7 |
+
sincnet:
|
8 |
+
stride: 10
|
9 |
+
lstm:
|
10 |
+
hidden_size: 128
|
11 |
+
num_layers: 4
|
12 |
+
bidirectional: true
|
13 |
+
monolithic: true
|
14 |
+
linear:
|
15 |
+
hidden_size: 128
|
16 |
+
num_layers: 2
|
example.png
ADDED
![]() |
gitattributes
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0b5b3216d60a2d32fc086b47ea8c67589aaeb26b7e07fcbe620d6d0b83e209ea
|
3 |
+
size 17719103
|