Update README.md
Browse files
README.md
CHANGED
@@ -1,39 +1,31 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
|
10 |
-
|
|
|
|
|
|
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
import torch
|
15 |
|
16 |
-
#
|
17 |
-
|
18 |
-
|
19 |
-
model.load_state_dict(state_dict)
|
20 |
|
21 |
-
# ์ถ๋ก
|
22 |
-
model.eval()
|
23 |
-
with torch.no_grad():
|
24 |
-
# ์ค๋์ค ์
๋ ฅ: (batch_size, audio_length)
|
25 |
-
audio = torch.randn(1, 16000) # 1์ด ์ค๋์ค ์์
|
26 |
-
output = model(audio)
|
27 |
-
print(f"Output shape: {output.shape}")
|
28 |
```
|
29 |
-
|
30 |
-
## ๋ชจ๋ธ ์์ธ
|
31 |
-
- ์ด ํ๋ผ๋ฏธํฐ: 54๊ฐ ๋ ์ด์ด
|
32 |
-
- ์ํคํ
์ฒ: SincNet + LSTM + Linear + Classifier
|
33 |
-
- ์
๋ ฅ: ์์ ์ค๋์ค ํํ
|
34 |
-
- ์ถ๋ ฅ: ํ์ ๋ถํ ๊ฒฐ๊ณผ
|
35 |
-
|
36 |
-
## ์๋ณธ ๋ชจ๋ธ
|
37 |
-
- Repository: jaeyong2/speaker-segmentation-merge
|
38 |
-
- ํค ๋งคํ 100% ์๋ฃ
|
39 |
-
- ๋ชจ๋ ์ฌ์ ํ๋ จ ๊ฐ์ค์น ๋ณด์กด
|
|
|
1 |
+
---
|
2 |
+
pipeline_tag: automatic-speech-recognition
|
3 |
+
---
|
4 |
+
# How to use
|
5 |
+
```
|
6 |
+
# instantiate the pipeline
|
7 |
+
from pyannote.audio import Pipeline
|
8 |
+
from diarizers import SegmentationModel
|
9 |
+
from pyannote.audio import Pipeline
|
10 |
+
import torch
|
11 |
|
12 |
+
device = torch.device("cuda:0") if torch.cuda.is_available() else torch.device("cpu")
|
13 |
|
14 |
+
# diarizers๋ฅผ ํตํด ๋ชจ๋ธ ๋ก๋
|
15 |
+
segmentation_model = SegmentationModel().from_pretrained('jaeyong2/speaker-segmentation-merged')
|
16 |
+
# pyannote ํธํ ํ์์ผ๋ก ๋ณํ
|
17 |
+
model3 = segmentation_model.to_pyannote_model()
|
18 |
|
19 |
+
pipeline = Pipeline.from_pretrained(
|
20 |
+
"pyannote/speaker-diarization-3.1",
|
21 |
+
use_auth_token=<auth_token>)
|
22 |
+
pipeline._segmentation.model = model3
|
23 |
|
24 |
+
# run the pipeline on an audio file
|
25 |
+
diarization = pipeline("output.wav")
|
|
|
26 |
|
27 |
+
# dump the diarization output to disk using RTTM format
|
28 |
+
with open("audio.rttm", "w") as rttm:
|
29 |
+
diarization.write_rttm(rttm)
|
|
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|