cemsubakan
commited on
Commit
•
9e4f7a6
1
Parent(s):
69d88c6
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: "en"
|
3 |
+
thumbnail:
|
4 |
+
tags:
|
5 |
+
- Source Separation
|
6 |
+
- Speech Separation
|
7 |
+
- Audio Source Separation
|
8 |
+
- SepFormer
|
9 |
+
- speechbrain
|
10 |
+
license: "apache-2.0"
|
11 |
+
datasets:
|
12 |
+
- WSJ0-2Mix
|
13 |
+
metrics:
|
14 |
+
- SI-SNRi
|
15 |
+
- SDRi
|
16 |
+
|
17 |
+
---
|
18 |
+
|
19 |
+
|
20 |
+
# SepFormer trained on WSJ0-2Mix
|
21 |
+
|
22 |
+
This repository provides all the necessary tools to perform audio source separation with a [SepFormer](https://arxiv.org/abs/2010.13154v2)
|
23 |
+
model, implemented with SpeechBrain, and pretrained on WSJ0-2Mix dataset. For a better experience we encourage you to learn more about
|
24 |
+
[SpeechBrain](https://speechbrain.github.io). The model performance is 22.4 dB on the test set of WSJ0-2Mix dataset.
|
25 |
+
|
26 |
+
| Release | Test-Set SI-SNRi | Test-Set SDRi |
|
27 |
+
|:-------------:|:--------------:|:--------------:|
|
28 |
+
| 09-03-21 | 22.4dB | 22.6dB |
|
29 |
+
|
30 |
+
|
31 |
+
## Install SpeechBrain
|
32 |
+
|
33 |
+
First of all, please install SpeechBrain with the following command:
|
34 |
+
|
35 |
+
```
|
36 |
+
pip install speechbrain
|
37 |
+
```
|
38 |
+
|
39 |
+
Please notice that we encourage you to read our tutorials and learn more about
|
40 |
+
[SpeechBrain](https://speechbrain.github.io).
|
41 |
+
|
42 |
+
### Perform source separation on your own audio file
|
43 |
+
```python
|
44 |
+
from speechbrain.pretrained import SepformerSeparation as separator
|
45 |
+
import torchaudio
|
46 |
+
|
47 |
+
model = separator.from_hparams(source="speechbrain/sepformer-wsj02mix", savedir='pretrained_models/sepformer-wsj02mix')
|
48 |
+
|
49 |
+
# for custom file, change path
|
50 |
+
est_sources = model.separate_file(path='speechbrain/sepformer-wsj02mix/test_mixture.wav')
|
51 |
+
|
52 |
+
torchaudio.save("source1hat.wav", est_sources[:, :, 0].detach().cpu(), 8000)
|
53 |
+
torchaudio.save("source2hat.wav", est_sources[:, :, 1].detach().cpu(), 8000)
|
54 |
+
|
55 |
+
```
|
56 |
+
|
57 |
+
### Inference on GPU
|
58 |
+
To perform inference on the GPU, add `run_opts={"device":"cuda"}` when calling the `from_hparams` method.
|
59 |
+
|
60 |
+
### Training
|
61 |
+
The model was trained with SpeechBrain (fc2eabb7).
|
62 |
+
To train it from scratch follows these steps:
|
63 |
+
1. Clone SpeechBrain:
|
64 |
+
```bash
|
65 |
+
git clone https://github.com/speechbrain/speechbrain/
|
66 |
+
```
|
67 |
+
2. Install it:
|
68 |
+
```
|
69 |
+
cd speechbrain
|
70 |
+
pip install -r requirements.txt
|
71 |
+
pip install -e .
|
72 |
+
```
|
73 |
+
|
74 |
+
3. Run Training:
|
75 |
+
```
|
76 |
+
cd recipes/WSJ0Mix/separation
|
77 |
+
python train.py hparams/sepformer.yaml --data_folder=your_data_folder
|
78 |
+
```
|
79 |
+
|
80 |
+
You can find our training results (models, logs, etc) [here](https://drive.google.com/drive/folders/1cON-eqtKv_NYnJhaE9VjLT_e2ybn-O7u?usp=sharing).
|
81 |
+
|
82 |
+
### Limitations
|
83 |
+
The SpeechBrain team does not provide any warranty on the performance achieved by this model when used on other datasets.
|
84 |
+
|
85 |
+
#### Referencing SpeechBrain
|
86 |
+
|
87 |
+
```bibtex
|
88 |
+
@misc{speechbrain,
|
89 |
+
title={{SpeechBrain}: A General-Purpose Speech Toolkit},
|
90 |
+
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},
|
91 |
+
year={2021},
|
92 |
+
eprint={2106.04624},
|
93 |
+
archivePrefix={arXiv},
|
94 |
+
primaryClass={eess.AS},
|
95 |
+
note={arXiv:2106.04624}
|
96 |
+
}
|
97 |
+
```
|
98 |
+
|
99 |
+
|
100 |
+
#### Referencing SepFormer
|
101 |
+
```bibtex
|
102 |
+
@inproceedings{subakan2021attention,
|
103 |
+
title={Attention is All You Need in Speech Separation},
|
104 |
+
author={Cem Subakan and Mirco Ravanelli and Samuele Cornell and Mirko Bronzi and Jianyuan Zhong},
|
105 |
+
year={2021},
|
106 |
+
booktitle={ICASSP 2021}
|
107 |
+
}
|
108 |
+
```
|
109 |
+
|
110 |
+
# **About SpeechBrain**
|
111 |
+
- Website: https://speechbrain.github.io/
|
112 |
+
- Code: https://github.com/speechbrain/speechbrain/
|
113 |
+
- HuggingFace: https://huggingface.co/speechbrain/
|