🚀 在WSJ0 - 2Mix上训练的RE - SepFormer
本仓库提供了使用基于 RE - SepFormer 模型进行音频源分离所需的所有工具。该模型使用SpeechBrain实现,并在WSJ0 - 2Mix数据集上进行了预训练。为了获得更好的体验,我们建议您进一步了解 SpeechBrain。该模型在WSJ0 - 2Mix数据集测试集上的性能为18.6 dB。
版本发布日期 |
测试集SI - SNRi |
测试集SDRi |
22年6月19日 |
18.6dB |
18.9dB |
🚀 快速开始
本仓库提供了使用 RE - SepFormer 模型进行音频源分离的工具,该模型使用SpeechBrain实现,并在WSJ0 - 2Mix数据集上预训练。建议您了解更多关于 SpeechBrain 的信息。模型在WSJ0 - 2Mix数据集测试集上的性能为18.6 dB。
✨ 主要特性
- 提供基于RE - SepFormer模型的音频源分离工具。
- 模型使用SpeechBrain实现并在WSJ0 - 2Mix数据集上预训练。
- 给出了模型在测试集上的性能指标(SI - SNRi和SDRi)。
📦 安装指南
安装SpeechBrain
首先,请使用以下命令安装SpeechBrain:
pip install speechbrain
请注意,我们建议您阅读我们的教程,进一步了解 SpeechBrain。
💻 使用示例
基础用法
在您自己的音频文件上进行源分离:
from speechbrain.inference.separation import SepformerSeparation as separator
import torchaudio
model = separator.from_hparams(source="speechbrain/resepformer-wsj02mix", savedir='pretrained_models/resepformer-wsj02mix')
est_sources = model.separate_file(path='speechbrain/sepformer-wsj02mix/test_mixture.wav')
torchaudio.save("source1hat.wav", est_sources[:, :, 0].detach().cpu(), 8000)
torchaudio.save("source2hat.wav", est_sources[:, :, 1].detach().cpu(), 8000)
系统期望输入的录音采样率为8kHz(单声道)。如果您的信号采样率不同,请在使用该接口之前对其进行重采样(例如,使用torchaudio或sox)。
高级用法
在GPU上进行推理
要在GPU上进行推理,请在调用 from_hparams
方法时添加 run_opts={"device":"cuda"}
。
📚 详细文档
训练
该模型使用SpeechBrain(fc2eabb7)进行训练。要从头开始训练,请按照以下步骤操作:
- 克隆SpeechBrain:
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
您可以在 这里 找到我们的训练结果(模型、日志等)。
局限性
SpeechBrain团队不保证该模型在其他数据集上的性能。
📄 许可证
本项目采用Apache - 2.0许可证。
🔖 引用信息
引用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}
}
引用RE - SepFormer
@inproceedings{dellalibera2024resourceefficient,
title={Resource-Efficient Separation Transformer},
author={Luca Della Libera and Cem Subakan and Mirco Ravanelli and Samuele Cornell and Frédéric Lepoutre and François Grondin},
year={2024},
booktitle={ICASSP 2024},
}
🔗 关于SpeechBrain
- 网站:https://speechbrain.github.io/
- 代码:https://github.com/speechbrain/speechbrain/
- HuggingFace:https://huggingface.co/speechbrain/