poonehmousavi
commited on
Commit
•
e34d2a7
1
Parent(s):
bd08b9b
Update README (2).md
Browse files- README (2).md +15 -14
README (2).md
CHANGED
@@ -10,6 +10,7 @@ tags:
|
|
10 |
- pytorch
|
11 |
- ECAPA
|
12 |
- TDNN
|
|
|
13 |
license: "apache-2.0"
|
14 |
datasets:
|
15 |
- voxceleb
|
@@ -25,23 +26,20 @@ widget:
|
|
25 |
<iframe src="https://ghbtns.com/github-btn.html?user=speechbrain&repo=speechbrain&type=star&count=true&size=large&v=2" frameborder="0" scrolling="0" width="170" height="30" title="GitHub"></iframe>
|
26 |
<br/><br/>
|
27 |
|
28 |
-
# Speaker Verification with ECAPA-TDNN embeddings on Voxceleb
|
29 |
|
30 |
-
This repository provides all the necessary tools to perform speaker verification with a pretrained ECAPA-TDNN model using SpeechBrain.
|
31 |
The system can be used to extract speaker embeddings as well.
|
32 |
-
It is trained on Voxceleb 1
|
33 |
|
34 |
For a better experience, we encourage you to learn more about
|
35 |
[SpeechBrain](https://speechbrain.github.io). The model performance on Voxceleb1-test set(Cleaned) is:
|
36 |
|
37 |
-
| Release | EER(%)
|
38 |
-
|:-------------:|:--------------:|
|
39 |
-
| 05-03-21 | 0.80 |
|
40 |
|
41 |
|
42 |
## Pipeline description
|
43 |
|
44 |
-
This system is composed of an ECAPA-TDNN model. It is a combination of convolutional and residual blocks. The embeddings are extracted using attentive statistical pooling. The system is trained with Additive Margin Softmax Loss. Speaker Verification is performed using cosine distance between speaker embeddings.
|
45 |
|
46 |
## Install SpeechBrain
|
47 |
|
@@ -58,15 +56,18 @@ Please notice that we encourage you to read our tutorials and learn more about
|
|
58 |
|
59 |
```python
|
60 |
import torchaudio
|
61 |
-
from speechbrain.inference.
|
62 |
-
|
63 |
-
|
|
|
|
|
64 |
embeddings = classifier.encode_batch(signal)
|
|
|
65 |
```
|
66 |
The system is trained with recordings sampled at 16kHz (single channel).
|
67 |
The code will automatically normalize your audio (i.e., resampling + mono channel selection) when calling *classify_file* if needed. Make sure your input tensor is compliant with the expected sampling rate if you use *encode_batch* and *classify_batch*.
|
68 |
|
69 |
-
### Perform Speaker Verification
|
70 |
|
71 |
```python
|
72 |
from speechbrain.inference.speaker import SpeakerRecognition
|
@@ -74,9 +75,9 @@ verification = SpeakerRecognition.from_hparams(source="speechbrain/spkrec-ecapa-
|
|
74 |
score, prediction = verification.verify_files("tests/samples/ASR/spk1_snt1.wav", "tests/samples/ASR/spk2_snt1.wav") # Different Speakers
|
75 |
score, prediction = verification.verify_files("tests/samples/ASR/spk1_snt1.wav", "tests/samples/ASR/spk1_snt2.wav") # Same Speaker
|
76 |
```
|
77 |
-
The prediction is 1 if the two signals in input are from the same speaker and 0 otherwise.
|
78 |
|
79 |
-
### Inference on GPU
|
80 |
To perform inference on the GPU, add `run_opts={"device":"cuda"}` when calling the `from_hparams` method.
|
81 |
|
82 |
### Training
|
@@ -100,7 +101,7 @@ python train_speaker_embeddings.py hparams/train_ecapa_tdnn.yaml --data_folder=y
|
|
100 |
```
|
101 |
|
102 |
You can find our training results (models, logs, etc) [here](https://drive.google.com/drive/folders/1-ahC1xeyPinAHp2oAohL-02smNWO41Cc?usp=sharing).
|
103 |
-
|
104 |
### Limitations
|
105 |
The SpeechBrain team does not provide any warranty on the performance achieved by this model when used on other datasets.
|
106 |
|
|
|
10 |
- pytorch
|
11 |
- ECAPA
|
12 |
- TDNN
|
13 |
+
- Discrete_SSL
|
14 |
license: "apache-2.0"
|
15 |
datasets:
|
16 |
- voxceleb
|
|
|
26 |
<iframe src="https://ghbtns.com/github-btn.html?user=speechbrain&repo=speechbrain&type=star&count=true&size=large&v=2" frameborder="0" scrolling="0" width="170" height="30" title="GitHub"></iframe>
|
27 |
<br/><br/>
|
28 |
|
29 |
+
# Speaker Verification with ECAPA-TDNN embeddings with discrete_ssl input on Voxceleb
|
30 |
|
31 |
+
This repository provides all the necessary tools to perform speaker verification with a pretrained ECAPA-TDNN model and discrete audio input using SpeechBrain.
|
32 |
The system can be used to extract speaker embeddings as well.
|
33 |
+
It is trained on Voxceleb 1 training data.
|
34 |
|
35 |
For a better experience, we encourage you to learn more about
|
36 |
[SpeechBrain](https://speechbrain.github.io). The model performance on Voxceleb1-test set(Cleaned) is:
|
37 |
|
|
|
|
|
|
|
38 |
|
39 |
|
40 |
## Pipeline description
|
41 |
|
42 |
+
This system is composed of an ECAPA-TDNN model and discrete_ssl model. It is a combination of convolutional and residual blocks. The embeddings are extracted using attentive statistical pooling. The system is trained with Additive Margin Softmax Loss. Speaker Verification is performed using cosine distance between speaker embeddings.
|
43 |
|
44 |
## Install SpeechBrain
|
45 |
|
|
|
56 |
|
57 |
```python
|
58 |
import torchaudio
|
59 |
+
from speechbrain.inference.interfaces import foreign_class
|
60 |
+
|
61 |
+
classifier = foreign_class(source="poonehmousavi/discrete_wavlm_spk_rec_ecapatdn", pymodule_file="custom_interface.py", classname="CustomEncoderClassifier")
|
62 |
+
|
63 |
+
signal, fs =torchaudio.load('poonehmousavi/discrete_wavlm_spk_rec_ecapatdn/example1.wav')
|
64 |
embeddings = classifier.encode_batch(signal)
|
65 |
+
print(embeddings.shape)
|
66 |
```
|
67 |
The system is trained with recordings sampled at 16kHz (single channel).
|
68 |
The code will automatically normalize your audio (i.e., resampling + mono channel selection) when calling *classify_file* if needed. Make sure your input tensor is compliant with the expected sampling rate if you use *encode_batch* and *classify_batch*.
|
69 |
|
70 |
+
<!-- ### Perform Speaker Verification
|
71 |
|
72 |
```python
|
73 |
from speechbrain.inference.speaker import SpeakerRecognition
|
|
|
75 |
score, prediction = verification.verify_files("tests/samples/ASR/spk1_snt1.wav", "tests/samples/ASR/spk2_snt1.wav") # Different Speakers
|
76 |
score, prediction = verification.verify_files("tests/samples/ASR/spk1_snt1.wav", "tests/samples/ASR/spk1_snt2.wav") # Same Speaker
|
77 |
```
|
78 |
+
The prediction is 1 if the two signals in input are from the same speaker and 0 otherwise. -->
|
79 |
|
80 |
+
<!-- ### Inference on GPU
|
81 |
To perform inference on the GPU, add `run_opts={"device":"cuda"}` when calling the `from_hparams` method.
|
82 |
|
83 |
### Training
|
|
|
101 |
```
|
102 |
|
103 |
You can find our training results (models, logs, etc) [here](https://drive.google.com/drive/folders/1-ahC1xeyPinAHp2oAohL-02smNWO41Cc?usp=sharing).
|
104 |
+
-->
|
105 |
### Limitations
|
106 |
The SpeechBrain team does not provide any warranty on the performance achieved by this model when used on other datasets.
|
107 |
|