Guided source-separation system inspired by Mel-Band RoFormer, adapted to take a reference/condition signal (e.g. a hummed melody) as in User-Guided Generative Source Separation.
Built on lightning-hydra-template (PyTorch Lightning + Hydra).
mixture waveform → STFT → MelBandProjection → MelBandMaskEstimator → iSTFT → separated
gmss/
├── .project-root
├── configs/
│ ├── test_separation.yaml
│ ├── data/guidesep_smoke.yaml
│ ├── model/separation_smoke.yaml
│ ├── trainer/cpu.yaml
│ ├── paths/default.yaml
│ ├── hydra/default.yaml
│ └── extras/default.yaml
├── src/
│ ├── test_separation.py # Hydra entry point (smoke test)
│ ├── data/
│ │ ├── audio_loader.py
│ │ ├── dataset.py
│ │ └── guidesep_datamodule.py
│ ├── models/
│ │ ├── separation_smoke_module.py
│ │ └── components/
│ │ ├── feature_config.py
│ │ ├── minimal_separator.py
│ │ └── features/
│ └── utils/
├── external/GuideSep/ # reference audio (gitignored)
└── requirements.txt
conda create -n gmss python=3.8
conda activate gmss
# install pytorch (>=2.0.1)
conda install pytorch torchvision torchaudio -c pytorch -c nvidia
pip install -r requirements.txtOn CPU-only machines, replace the conda line with:
conda install pytorch torchvision torchaudio cpuonly -c pytorchconda activate gmss
python src/test_separation.pyOverride config from CLI:
python src/test_separation.py data.segment_seconds=5.0Expected metrics:
| Case | RMSE vs mixture |
|---|---|
init_identity=True |
≈ 1e-8 (output ≈ mixture) |
init_identity=False |
~0.15 (random mask, end-to-end demo) |
- Hydra configs compose data, model, and trainer; paths resolve via
${paths.root_dir}. FeatureConfigis shared across STFT, mel-band split, and mask estimator.MelBandProjectionis a band split, not a mel spectrogram — it preserves complex phase for iSTFT.- Manifest-driven dataset: triplets
{mixture, reference, target}decouple data paths from code.