安装
conda或者pip方式安装
conda || pip
wget -c https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh
#pip
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
spleeter
#conda
conda install -c conda-forge spleeter
conda install -c conda-forge spleeter-gpu
#pip
pip install spleeter
pip install spleeter-gpu
#预测模型
tar -xvf 2stems.tar.gz -C 2stems
tar -xvf 4stems.tar.gz -C 4stems
tar -xvf 5stems.tar.gz -C 5stems
使用
spleeter separate -i ./original.wav --verbose -p spleeter:5stems -o ./
常见问题
- 预测模型下载太慢,可以手动下载,在当前执行目录下建立文件夹 pretrained_models,手动解压就行,下面是目录结构
pretrained_models/
├── 2stems
│ ├── checkpoint
│ ├── model.data-00000-of-00001
│ ├── model.index
│ └── model.meta
├── 2stems.tar.gz
├── 4stems
│ ├── checkpoint
│ ├── model.data-00000-of-00001
│ ├── model.index
│ └── model.meta
├── 4stems.tar.gz
├── 5stems
│ ├── checkpoint
│ ├── model.data-00000-of-00001
│ ├── model.index
│ └── model.meta
└── 5stems.tar.gz
2.在java环境中找不到 spleeter命令
whereis spleeter
ln -s ....../spleeter /usr/local/bin/spleeter