🚀 基於Libri3Mix訓練的SepFormer模型
本倉庫提供了使用 SepFormer 模型進行音頻源分離所需的所有工具。該模型使用 SpeechBrain 實現,並在 Libri3Mix 數據集上進行了預訓練。為了獲得更好的使用體驗,我們建議您進一步瞭解 SpeechBrain。該模型在 Libri3Mix 數據集測試集上的 SI - SNRi 性能達到 19.8 dB。
版本發佈日期 |
測試集 SI - SNRi |
測試集 SDRi |
22年9月16日 |
19.0dB |
19.4dB |
🚀 快速開始
本項目提供了基於 SepFormer 模型進行音頻源分離的工具,下面將介紹如何使用這些工具。
📦 安裝指南
首先,請使用以下命令安裝 SpeechBrain:
pip install speechbrain
請注意,我們建議您閱讀我們的教程,進一步瞭解 SpeechBrain。
💻 使用示例
基礎用法
在您自己的音頻文件上執行源分離:
from speechbrain.pretrained import SepformerSeparation as separator
import torchaudio
model = separator.from_hparams(source="speechbrain/sepformer-libri3mix", savedir='pretrained_models/sepformer-libri3mix')
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 上進行推理
要在 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/LibriMix/separation
python train.py hparams/sepformer.yaml --data_folder=your_data_folder
注意:請在 yaml 文件中將 num_spks
更改為 3。
您可以在 這裡 找到我們的訓練結果(模型、日誌等)。
侷限性
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}
}
@article{subakan2023exploring,
author={Subakan, Cem and Ravanelli, Mirco and Cornell, Samuele and Grondin, François and Bronzi, Mirko},
journal={IEEE/ACM Transactions on Audio, Speech, and Language Processing},
title={Exploring Self-Attention Mechanisms for Speech Separation},
year={2023},
volume={31},
pages={2169-2180},
📄 許可證
本項目採用 Apache 2.0 許可證。
關於 SpeechBrain
- 官網:https://speechbrain.github.io/
- 代碼倉庫:https://github.com/speechbrain/speechbrain/
- HuggingFace 頁面:https://huggingface.co/speechbrain/
標籤
- 源分離
- 語音分離
- 音頻源分離
- Libri3Mix
- SepFormer
- Transformer
- 音頻到音頻
- 音頻源分離
- SpeechBrain
數據集
評估指標