A PyTorch Lightning toolkit for audio separation
- Live visualization of training progress
- Smart checkpoint loading with parameter matching
- Validation loss and SDR statistics while training
- Toolkit of
nn.Modules for more easily building your own models
- Python 3.8+
- CUDA-compatible GPU
First, create and activate a Python virtual environment:
# Create virtual environment
python -m venv musicsep-env
# Activate virtual environment
# On Windows:
musicsep-env\Scripts\activate
# On macOS/Linux:
source musicsep-env/bin/activateInstall all required packages:
pip install -r requirements.txtThe dataset directory you specify in the config must have the following structure:
dataset/
├── train/
└── test/
Both the train and test folders must contain audio files in WAV format corresponding to the stems you select in the
config's target_sources parameter.
To start training the model:
python main.pyThis will start training the model defined in the config: config/config.yaml.
To run inference on audio files:
-
Set the mode to inference in
./config/config.yaml:mode: inference
-
Specify the input folder containing your audio files:
paths: inference_input: "/path/to/your/audio/files"
-
Provide a trained checkpoint to load:
paths: resume_from: "/path/to/your/checkpoint.ckpt"
-
Run inference:
python main.py
The inference will process audio files from the inference_input directory and separate them into the stems specified
in target_sources.
If you're using PyCharm and the training progress bar is not showing up during training, enable the "Emulate terminal in output console" option in your run configuration:
- Go to Run → Edit Configurations...
- Select your Python configuration
- Under Execution, check the box for "Emulate terminal in output console"
- Click Apply and OK
This will allow the progress bar to display correctly in PyCharm's output console.
If you encounter verbose warning messages during training or inference, you can suppress them by using:
python -W ignore main.pyMIT License - see LICENSE for details.