How deezer/spleeter works
Spleeter is a Python/TensorFlow music source-separation library, usable from the CLI or as a library. The principal workflow accepts an audio file, resolves a pretrained model configuration and model files, separates the waveform into instrument stems, then writes stem files. A distinct training/evaluation branch builds datasets from isolated-source audio and uses the model estimator. The graph preserves documented 2-, 4-, and 5-stem capabilities. Some subsystem details are represented by their existing directories because their implementation files were not excerpted; those relationships are omitted where evidence is unavailable.
Main entry points: __main__.py CLI commands · separator.py Separator · dataset.py Dataset pipeline · __init__.py Estimator and masks
Components 19
User entry
- CLI commands
spleeter/__main__.py - Command options
spleeter/options.py - Configuration loader
spleeter/utils/configuration.py
Audio I/O
- Audio adapter
spleeter/audio/adapter.py - FFmpeg adapter
spleeter/audio/ffmpeg.py - Waveform conversion
spleeter/audio/convertor.py - Spectrogram transforms
spleeter/audio/spectrogram.py
Separation runtime
- Separator
spleeter/separator.py - Estimator and masks
spleeter/model/__init__.py - U-Net model
spleeter/model/functions/unet.py - BLSTM model
spleeter/model/functions/blstm.py
Training and evaluation
- Dataset pipeline
spleeter/dataset.py - Train and evaluate
spleeter/__main__.py - Tensor utilities
spleeter/utils/tensor.py
Model assets
- Model provider
spleeter/model/provider/__init__.py - GitHub model download
spleeter/model/provider/github.py - Preset configurations
spleeter/resources - Local model files
Other components
- CLI or API user
Connections 23
- CLI or API user → CLI commands: runs commands
README.md - CLI or API user → Separator: calls API
README.md - CLI commands → Command options: parses options
spleeter/__main__.py - CLI commands → Configuration loader: loads configuration
spleeter/__main__.py - CLI commands → Separator: runs separation
spleeter/__main__.py - CLI commands → Dataset pipeline: builds datasets
spleeter/__main__.py - CLI commands → Train and evaluate: dispatches training
spleeter/__main__.py - Separator → Model provider: resolves model
spleeter/separator.py - Model provider → GitHub model download: downloads through
spleeter/model/provider/__init__.py - GitHub model download → Local model files: writes model files
spleeter/model/provider/github.py - Configuration loader → Preset configurations: reads embedded presets
spleeter/utils/configuration.py - Separator → Audio adapter: loads and saves audio
spleeter/separator.py - Audio adapter → FFmpeg adapter: uses default adapter
spleeter/audio/adapter.py - Separator → Estimator and masks: builds estimator
spleeter/separator.py - Estimator and masks → U-Net model: selects model function
spleeter/model/__init__.py - Estimator and masks → BLSTM model: selects model function
spleeter/model/__init__.py - Separator → Waveform conversion: converts waveforms
spleeter/separator.py - Dataset pipeline → Audio adapter: loads training audio
spleeter/dataset.py - Dataset pipeline → Waveform conversion: uses conversion helpers
spleeter/dataset.py - Dataset pipeline → Spectrogram transforms: computes spectrograms
spleeter/dataset.py - Dataset pipeline → Tensor utilities: uses tensor helpers
spleeter/dataset.py - Train and evaluate → Dataset pipeline: requests datasets
spleeter/__main__.py - Train and evaluate → Estimator and masks: runs estimator
spleeter/__main__.py