模型:
speechbrain/sepformer-wsj03mix
该存储库提供了使用SpeechBrain实现的 SepFormer 模型以及在WSJ0-3Mix数据集上进行预训练的所有必要工具,用于进行音频源分离。为了更好的体验,我们鼓励您了解 SpeechBrain 。该模型在WSJ0-3Mix数据集的测试集上的性能为19.8 dB SI-SNRi。
Release | Test-Set SI-SNRi | Test-Set SDRi |
---|---|---|
09-03-21 | 19.8dB | 20.0dB |
首先,请使用以下命令安装SpeechBrain:
pip install speechbrain
请注意,我们鼓励您阅读我们的教程,并了解 SpeechBrain 。
from speechbrain.pretrained import SepformerSeparation as separator import torchaudio model = separator.from_hparams(source="speechbrain/sepformer-wsj03mix", savedir='pretrained_models/sepformer-wsj03mix') est_sources = model.separate_file(path='speechbrain/sepformer-wsj03mix/test_mixture_3spks.wav') torchaudio.save("source1hat.wav", est_sources[:, :, 0].detach().cpu(), 8000) torchaudio.save("source2hat.wav", est_sources[:, :, 1].detach().cpu(), 8000) torchaudio.save("source3hat.wav", est_sources[:, :, 2].detach().cpu(), 8000)
系统需要以8kHz采样的输入录音(单声道)。如果您的信号具有不同的采样率,请在使用界面之前将其重采样(例如使用torchaudio或sox)。
要在GPU上执行推理,在调用from_hparams方法时添加run_opts={"device":"cuda"}。
该模型使用SpeechBrain (fc2eabb7)进行训练。要从头开始训练,请按照以下步骤进行:
git clone https://github.com/speechbrain/speechbrain/
cd speechbrain pip install -r requirements.txt pip install -e .
cd recipes/WSJ0Mix/separation python train.py hparams/sepformer.yaml --data_folder=your_data_folder
注意:在yaml文件中将num_spks更改为3。
您可以在导航模型,日志等方面找到我们的训练结果 here 。
SpeechBrain团队不对在其他数据集上使用该模型的性能提供任何保证。
引用SpeechBrain@misc{speechbrain, title={{SpeechBrain}: A General-Purpose Speech Toolkit}, 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}, year={2021}, eprint={2106.04624}, archivePrefix={arXiv}, primaryClass={eess.AS}, note={arXiv:2106.04624} }引用SepFormer
@inproceedings{subakan2021attention, title={Attention is All You Need in Speech Separation}, author={Cem Subakan and Mirco Ravanelli and Samuele Cornell and Mirko Bronzi and Jianyuan Zhong}, year={2021}, booktitle={ICASSP 2021} }