subakany commited on
Commit
6dbfa1f
·
2 Parent(s): a68317d df2793d

Merge branch 'main' of https://huggingface.co/speechbrain/sepformer-whamr-enhancement into main

Browse files
Files changed (1) hide show
  1. README.md +119 -0
README.md ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: "en"
3
+ thumbnail:
4
+ tags:
5
+ - audio-to-audio
6
+ - audio-source-separation
7
+ - Source Separation
8
+ - Speech Separation
9
+ - WHAM!
10
+ - SepFormer
11
+ - Transformer
12
+ - pytorch
13
+ - speechbrain
14
+ license: "apache-2.0"
15
+ datasets:
16
+ - WHAMR!
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 WHAMR! for speech enhancement (8k sampling frequency)
27
+ This repository provides all the necessary tools to perform speech enhancement (denoising + dereverberation) with a [SepFormer](https://arxiv.org/abs/2010.13154v2) model, implemented with SpeechBrain, and pretrained on [WHAMR!](http://wham.whisper.ai/) dataset with 8k sampling frequency, which is basically a version of WSJ0-Mix dataset with environmental noise and reverberation in 8k. For a better experience we encourage you to learn more about [SpeechBrain](https://speechbrain.github.io). The given model performance is 13.5 dB SI-SNRi on the test set of WHAMR! dataset.
28
+
29
+
30
+ | Release | Test-Set SI-SNR | Test-Set PESQ |
31
+ |:-------------:|:--------------:|:--------------:|
32
+ | 01-12-21 | | |
33
+
34
+
35
+ ## Install SpeechBrain
36
+
37
+ First of all, please install SpeechBrain with the following command:
38
+
39
+ ```
40
+ pip install speechbrain
41
+ ```
42
+
43
+ Please notice that we encourage you to read our tutorials and learn more about [SpeechBrain](https://speechbrain.github.io).
44
+
45
+ ### Perform source separation on your own audio file
46
+
47
+ ```python
48
+ from speechbrain.pretrained import SepformerSeparation as separator
49
+ import torchaudio
50
+
51
+ model = separator.from_hparams(source="speechbrain/sepformer-whamr16k", savedir='pretrained_models/sepformer-whamr16k')
52
+
53
+ # for custom file, change path
54
+ est_sources = model.separate_file(path='speechbrain/sepformer-whamr16k/test_mixture16k.wav')
55
+
56
+ torchaudio.save("source1hat.wav", est_sources[:, :, 0].detach().cpu(), 16000)
57
+ torchaudio.save("source2hat.wav", est_sources[:, :, 1].detach().cpu(), 16000)
58
+ ```
59
+
60
+ The system expects input recordings sampled at 16kHz (single channel).
61
+ If your signal has a different sample rate, resample it (e.g, using torchaudio or sox) before using the interface.
62
+
63
+ ### Inference on GPU
64
+ To perform inference on the GPU, add `run_opts={"device":"cuda"}` when calling the `from_hparams` method.
65
+
66
+ ### Training
67
+ The model was trained with SpeechBrain (fc2eabb7).
68
+ To train it from scratch follows these steps:
69
+ 1. Clone SpeechBrain:
70
+ ```bash
71
+ git clone https://github.com/speechbrain/speechbrain/
72
+ ```
73
+ 2. Install it:
74
+ ```
75
+ cd speechbrain
76
+ pip install -r requirements.txt
77
+ pip install -e .
78
+ ```
79
+
80
+ 3. Run Training:
81
+ ```
82
+ cd recipes/WHAMandWHAMR/separation/
83
+ python train.py hparams/sepformer-whamr.yaml --data_folder=your_data_folder --sample_rate=16000
84
+ ```
85
+
86
+ You can find our training results (models, logs, etc) [here](https://drive.google.com/drive/folders/1QiQhp1vi5t4UfNpNETA48_OmPiXnUy8O?usp=sharing).
87
+
88
+ ### Limitations
89
+ The SpeechBrain team does not provide any warranty on the performance achieved by this model when used on other datasets.
90
+
91
+ #### Referencing SpeechBrain
92
+
93
+ ```bibtex
94
+ @misc{speechbrain,
95
+ title={{SpeechBrain}: A General-Purpose Speech Toolkit},
96
+ 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},
97
+ year={2021},
98
+ eprint={2106.04624},
99
+ archivePrefix={arXiv},
100
+ primaryClass={eess.AS},
101
+ note={arXiv:2106.04624}
102
+ }
103
+ ```
104
+
105
+
106
+ #### Referencing SepFormer
107
+ ```bibtex
108
+ @inproceedings{subakan2021attention,
109
+ title={Attention is All You Need in Speech Separation},
110
+ author={Cem Subakan and Mirco Ravanelli and Samuele Cornell and Mirko Bronzi and Jianyuan Zhong},
111
+ year={2021},
112
+ booktitle={ICASSP 2021}
113
+ }
114
+ ```
115
+
116
+ # **About SpeechBrain**
117
+ - Website: https://speechbrain.github.io/
118
+ - Code: https://github.com/speechbrain/speechbrain/
119
+ - HuggingFace: https://huggingface.co/speechbrain/