MCPcopy Index your code
hub / github.com/ZFTurbo/Music-Source-Separation-Training

github.com/ZFTurbo/Music-Source-Separation-Training @v1.0.21

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.21 ↗ · + Follow
1,285 symbols 3,641 edges 101 files 227 documented · 18% updated 5d agov1.0.21 · 2026-04-20★ 1,42961 open issues

Browse by type

Functions 993 Types & classes 292
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Music Source Separation Universal Training Code

Repository for training models for music source separation. Repository is based on kuielab code for SDX23 challenge. The main idea of this repository is to create training code, which is easy to modify for experiments. Brought to you by MVSep.com.

Models

Model can be chosen with --model_type arg.

Available models for training:

How to: Train

To train model you need to:

1) Choose model type with option --model_type, including: mdx23c, htdemucs, segm_models, mel_band_roformer, bs_roformer. 2) Choose location of config for model --config_path <config path>. You can find examples of configs in configs folder. Prefixes config_musdb18_ are examples for MUSDB18 dataset. 3) If you have a check-point from the same model or from another similar model you can use it with option: --start_check_point <weights path> 4) Choose path where to store results of training --results_path <results folder path>

Training example

python train.py \
    --model_type mel_band_roformer \
    --config_path configs/config_mel_band_roformer_vocals.yaml \
    --start_check_point results/model.ckpt \
    --results_path results/ \
    --data_path 'datasets/dataset1' 'datasets/dataset2' \
    --valid_path datasets/musdb18hq/test \
    --num_workers 4 \
    --device_ids 0

All training parameters are here.

Training with LoRA

Look here: LoRA training

How to: Inference

Inference example

python inference.py \
    --model_type mdx23c \
    --config_path configs/config_mdx23c_musdb18.yaml \
    --start_check_point results/last_mdx23c.ckpt \
    --input_folder input/wavs/ \
    --store_dir separation_results/

All inference parameters are here. Convert models to ONNX and TensorRT formats here.

Useful notes

  • All batch sizes in config are adjusted to use with single NVIDIA A6000 48GB. If you have less memory please adjust correspodningly in model config training.batch_size and training.gradient_accumulation_steps.
  • It's usually always better to start with old weights even if shapes not fully match. Code supports loading weights for not fully same models (but it must have the same architecture). Training will be much faster.

Code description

  • configs/config_*.yaml - configuration files for models
  • models/* - set of available models for training and inference
  • dataset.py - dataset which creates new samples for training
  • gui-wx.py - GUI interface for code
  • inference.py - process folder with music files and separate them
  • train.py - main training code for single GPU
  • train_ddp.py - training code for Multi GPU config. Faster than train.py. Use it for 2 or more GPUs.
  • utils.py - common functions used by train/valid
  • valid.py - validation of model with metrics
  • ensemble.py - useful script to ensemble results of different models to make results better (see docs).

Pre-trained models

Look here: List of Pre-trained models

If you trained some good models, please, share them. You can post config and model weights in this issue.

Dataset types

Look here: Dataset types

Augmentations

Look here: Augmentations

Graphical user interface

Look here: GUI documentation or see tutorial on Youtube

Citation

@misc{solovyev2023benchmarks,
      title={Benchmarks and leaderboards for sound demixing tasks}, 
      author={Roman Solovyev and Alexander Stempkovskiy and Tatiana Habruseva},
      year={2023},
      eprint={2305.07489},
      archivePrefix={arXiv},
      primaryClass={cs.SD}
}

Core symbols most depended-on inside this repo

Shape

Method 709
Class 292
Function 284

Languages

Python100%

Modules by API surface

models/bandit/core/model/bsrnn/utils.py51 symbols
models/scnet/scnet_tran.py47 symbols
models/bs_roformer/mel_band_conformer.py43 symbols
models/bs_roformer/bs_conformer.py43 symbols
models/bandit_v2/utils.py39 symbols
models/bandit/core/__init__.py38 symbols
gui/gui-wx.py38 symbols
models/bs_mamba2_code/bs_mamba2.py32 symbols
models/bs_roformer/mel_band_roformer_experimental.py31 symbols
models/bs_roformer/mel_band_roformer.py31 symbols
models/bs_roformer/bs_roformer_experimental.py30 symbols
models/bs_roformer/bs_roformer.py30 symbols

For agents

$ claude mcp add Music-Source-Separation-Training \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page