deezer / spleeter

Deezer source separation library including pretrained models.
https://research.deezer.com/projects/spleeter.html
MIT License
25.63k stars 2.81k forks source link

[Discussion] Separate using original training models #633

Open makobouzu opened 3 years ago

makobouzu commented 3 years ago

Hi! Spleeter is very useful repository! Thx!

You can refer to the official spleeter wiki to proceed with the training.
In this issue, I will show you the next step, how I use original models to separate test sounds.

I used the spleeter system for audio source separation of field recordings.
Specifically, I tried to classify them into 3 stems: Human / Bird / Car.

# Train
spleeter train -p configs/***_config.json -d <path/to/dataset>
# You may be get ***_model folder including checkpoint / model.ckpt-200000.data-00000-of-00001 / model.ckpt-200000.index / model.ckpt-200000.meta. 

Move the original models to the pretrained_model folder.

# Create pretrained_model folder
mkdir pretrained_models
mkdir pretrained_models/3stems
# Move model files
mv ***_model/checkpoint pretrained_models/3stems 
mv ***_model/model.ckpt-200000.data-00000-of-00001 pretrained_models/3stems
mv ***_model/model.ckpt-200000.index pretrained_models/3stems
mv ***_model/model.ckpt-200000.meta pretrained_models/3stems
mv ***_model/.probe pretrained_models/3stems

Embed 3stems.json into the spleeter.

# Move 3stems.json
mv 3stems.json $HOME/.pyenv/versions/3.7.7/lib/python3.7/site-packages/spleeter/resources/

You can separate test sounds using original models.

# Separate
spleeter separate -p spleeter:3stems -o output audio_example.mp3
# You can get human.wav / bird.wav / car.wav

I couldn't find any information on how to embed it in spleeter or how to use models other than musdb, so I had to share this issue. For detail -> makobouzu / spleeter
thank you!!

[PC Settings] Mac OS: Catalina fish pyenv (pyenv-virtualenv) python 3.7.7

romi1502 commented 3 years ago

Hi @makobouzu, thank you for sharing your work! I'd be curious to hear the separated stems of your field recording trained model!