cemsubakan
commited on
Commit
•
43ffef3
1
Parent(s):
4386cc8
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,131 @@
|
|
1 |
---
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language: "en"
|
3 |
+
thumbnail:
|
4 |
+
tags:
|
5 |
+
- Source Separation
|
6 |
+
- Speech Separation
|
7 |
+
- Audio Source Separation
|
8 |
+
- Libri2Mix
|
9 |
+
- SepFormer
|
10 |
+
- Transformer
|
11 |
+
- audio-to-audio
|
12 |
+
- audio-source-separation
|
13 |
+
- speechbrain
|
14 |
+
license: "apache-2.0"
|
15 |
+
datasets:
|
16 |
+
- Libri2Mix
|
17 |
+
metrics:
|
18 |
+
- SI-SNRi
|
19 |
+
- SDRi
|
20 |
+
|
21 |
---
|
22 |
+
|
23 |
+
<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>
|
24 |
+
<br/><br/>
|
25 |
+
|
26 |
+
# SepFormer trained on Libri2Mix
|
27 |
+
|
28 |
+
This repository provides all the necessary tools to perform audio source separation with a [SepFormer](https://arxiv.org/abs/2010.13154v2)
|
29 |
+
model, implemented with SpeechBrain, and pretrained on Libri2Mix dataset. For a better experience we encourage you to learn more about
|
30 |
+
[SpeechBrain](https://speechbrain.github.io). The model performance is 20.6 dB on the test set of Libri2Mix dataset.
|
31 |
+
|
32 |
+
| Release | Test-Set SI-SNRi | Test-Set SDRi |
|
33 |
+
|:-------------:|:--------------:|:--------------:|
|
34 |
+
| 16-09-22 | 20.6dB | 20.9dB |
|
35 |
+
|
36 |
+
You can listen to example results obtained on the test set of WSJ0-2/3Mix through [here](https://sourceseparationresearch.com/static/sepformer_example_results/sepformer_results.html).
|
37 |
+
|
38 |
+
|
39 |
+
## Install SpeechBrain
|
40 |
+
|
41 |
+
First of all, please install SpeechBrain with the following command:
|
42 |
+
|
43 |
+
```
|
44 |
+
pip install speechbrain
|
45 |
+
```
|
46 |
+
|
47 |
+
Please notice that we encourage you to read our tutorials and learn more about
|
48 |
+
[SpeechBrain](https://speechbrain.github.io).
|
49 |
+
|
50 |
+
### Perform source separation on your own audio file
|
51 |
+
```python
|
52 |
+
from speechbrain.pretrained import SepformerSeparation as separator
|
53 |
+
import torchaudio
|
54 |
+
|
55 |
+
model = separator.from_hparams(source="speechbrain/sepformer-libri2mix", savedir='pretrained_models/sepformer-libri2mix')
|
56 |
+
|
57 |
+
# for custom file, change path
|
58 |
+
est_sources = model.separate_file(path='speechbrain/sepformer-wsj02mix/test_mixture.wav')
|
59 |
+
|
60 |
+
torchaudio.save("source1hat.wav", est_sources[:, :, 0].detach().cpu(), 8000)
|
61 |
+
torchaudio.save("source2hat.wav", est_sources[:, :, 1].detach().cpu(), 8000)
|
62 |
+
```
|
63 |
+
|
64 |
+
The system expects input recordings sampled at 8kHz (single channel).
|
65 |
+
If your signal has a different sample rate, resample it (e.g, using torchaudio or sox) before using the interface.
|
66 |
+
|
67 |
+
### Inference on GPU
|
68 |
+
To perform inference on the GPU, add `run_opts={"device":"cuda"}` when calling the `from_hparams` method.
|
69 |
+
|
70 |
+
### Training
|
71 |
+
The model was trained with SpeechBrain (fc2eabb7).
|
72 |
+
To train it from scratch follows these steps:
|
73 |
+
1. Clone SpeechBrain:
|
74 |
+
```bash
|
75 |
+
git clone https://github.com/speechbrain/speechbrain/
|
76 |
+
```
|
77 |
+
2. Install it:
|
78 |
+
```
|
79 |
+
cd speechbrain
|
80 |
+
pip install -r requirements.txt
|
81 |
+
pip install -e .
|
82 |
+
```
|
83 |
+
|
84 |
+
3. Run Training:
|
85 |
+
```
|
86 |
+
cd recipes/Libri2Mix/separation
|
87 |
+
python train.py hparams/sepformer.yaml --data_folder=your_data_folder
|
88 |
+
```
|
89 |
+
|
90 |
+
You can find our training results (models, logs, etc) [here](https://drive.google.com/drive/folders/1cON-eqtKv_NYnJhaE9VjLT_e2ybn-O7u?usp=sharing).
|
91 |
+
|
92 |
+
### Limitations
|
93 |
+
The SpeechBrain team does not provide any warranty on the performance achieved by this model when used on other datasets.
|
94 |
+
|
95 |
+
#### Referencing SpeechBrain
|
96 |
+
|
97 |
+
```bibtex
|
98 |
+
@misc{speechbrain,
|
99 |
+
title={{SpeechBrain}: A General-Purpose Speech Toolkit},
|
100 |
+
author={Mirco Ravanelli and Titouan Parcollet and Peter Plantinga and Aku Rouhe and Samuele Cornell and Loren Lugosch and Cem Subakan and Nauman Dawalatabad and Abdelwahab Heba and Jianyuan Zhong and Ju-Chieh Chou and Sung-Lin Yeh and Szu-Wei Fu and Chien-Feng Liao and Elena Rastorgueva and François Grondin and William Aris and Hwidong Na and Yan Gao and Renato De Mori and Yoshua Bengio},
|
101 |
+
year={2021},
|
102 |
+
eprint={2106.04624},
|
103 |
+
archivePrefix={arXiv},
|
104 |
+
primaryClass={eess.AS},
|
105 |
+
note={arXiv:2106.04624}
|
106 |
+
}
|
107 |
+
```
|
108 |
+
|
109 |
+
|
110 |
+
#### Referencing SepFormer
|
111 |
+
```bibtex
|
112 |
+
@inproceedings{subakan2021attention,
|
113 |
+
title={Attention is All You Need in Speech Separation},
|
114 |
+
author={Cem Subakan and Mirco Ravanelli and Samuele Cornell and Mirko Bronzi and Jianyuan Zhong},
|
115 |
+
year={2021},
|
116 |
+
booktitle={ICASSP 2021}
|
117 |
+
}
|
118 |
+
|
119 |
+
@misc{subakan2022sepformer
|
120 |
+
author = {Subakan, Cem and Ravanelli, Mirco and Cornell, Samuele and Grondin, Francois and Bronzi, Mirko},
|
121 |
+
title = {On Using Transformers for Speech-Separation},
|
122 |
+
year = {2022},
|
123 |
+
copyright = {arXiv.org perpetual, non-exclusive license}
|
124 |
+
}
|
125 |
+
|
126 |
+
```
|
127 |
+
|
128 |
+
# **About SpeechBrain**
|
129 |
+
- Website: https://speechbrain.github.io/
|
130 |
+
- Code: https://github.com/speechbrain/speechbrain/
|
131 |
+
- HuggingFace: https://huggingface.co/speechbrain/
|