Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,57 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
---
|
4 |
+
|
5 |
+
# Conformer based multilingual speaker encoder
|
6 |
+
|
7 |
+
## Summary
|
8 |
+
|
9 |
+
This is a massively multilingual conformer-based speaker recognition model.
|
10 |
+
|
11 |
+
The model was trained with public data only.
|
12 |
+
|
13 |
+
The paper: https://arxiv.org/abs/2104.02125
|
14 |
+
|
15 |
+
```
|
16 |
+
@inproceedings{chojnacka2021speakerstew,
|
17 |
+
title={{SpeakerStew: Scaling to many languages with a triaged multilingual text-dependent and text-independent speaker verification system}},
|
18 |
+
author={Chojnacka, Roza and Pelecanos, Jason and Wang, Quan and Moreno, Ignacio Lopez},
|
19 |
+
booktitle={Prod. Interspeech},
|
20 |
+
year={2021}
|
21 |
+
}
|
22 |
+
```
|
23 |
+
|
24 |
+
## Usage
|
25 |
+
|
26 |
+
Run use this model, you will need to use the `siglingvo` library: https://github.com/google/speaker-id/tree/master/lingvo
|
27 |
+
|
28 |
+
Since lingvo does not support Python 3.11 yet, make sure your Python is up to 3.10.
|
29 |
+
|
30 |
+
Install the library:
|
31 |
+
|
32 |
+
```
|
33 |
+
pip install sidlingvo
|
34 |
+
```
|
35 |
+
|
36 |
+
Example usage:
|
37 |
+
|
38 |
+
```Python
|
39 |
+
import os
|
40 |
+
from sidlingvo import wav_to_dvector
|
41 |
+
from huggingface_hub import hf_hub_download
|
42 |
+
|
43 |
+
repo_id = "tflite-hub/conformer-speaker-encoder"
|
44 |
+
model_path = "models"
|
45 |
+
hf_hub_download(repo_id=repo_id, filename="vad_long_model.tflite", local_dir=model_path)
|
46 |
+
hf_hub_download(repo_id=repo_id, filename="vad_long_mean_stddev.csv", local_dir=model_path)
|
47 |
+
hf_hub_download(repo_id=repo_id, filename="conformer_tisid_medium..tflite", local_dir=model_path)
|
48 |
+
|
49 |
+
enroll_wav_files = ["your_first_wav_file.wav"]
|
50 |
+
test_wav_file = "your_second_wav_file.wav"
|
51 |
+
runner = wav_to_dvector.WavToDvectorRunner(
|
52 |
+
vad_model_file=os.path.join(model_path, "vad_long_model.tflite"),
|
53 |
+
vad_mean_stddev_file=os.path.join(model_path, "vad_long_mean_stddev.csv"),
|
54 |
+
tisid_model_file=os.path.join(model_path, "conformer_tisid_medium.tflite"))
|
55 |
+
score = runner.compute_score(enroll_wav_files, test_wav_file)
|
56 |
+
print("Speaker similarity score:", score)
|
57 |
+
```
|