theadityamittal's picture
Add Gradio app for music source separation using U-Net model
ddc5705

A newer version of the Gradio SDK is available: 6.13.0

Upgrade
metadata
title: Music Separator Space
emoji: πŸ’»
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 5.34.1
app_file: app.py
pinned: false
license: mit

🎡 Music Source Separation Demo

This Gradio Space lets you upload any mono .wav music mix and instantly separate it into drums, bass, other, and vocals stems using a pretrained U-Net model.

πŸ‘‰ Try it live: https://huggingface.co/spaces/theadityamittal/music-separator-space


πŸ› οΈ How It Works

  1. Upload your mixture .wav (16 kHz mono).
  2. Internally, we compute an STFT and split it into fixed-length segments.
  3. A U-Net predicts magnitude masks for each source.
  4. We reconstruct each stem via inverse STFT using the original phase.
  5. Download your separated stems!

πŸ”§ Installation (Local)

If you want to run it locally instead of on the Space:

git clone https://huggingface.co/spaces/theadityamittal/music-separator-space
cd music-separator-space
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
python serve.py

Then open http://localhost:7860 in your browser.


πŸ—‚οΈ Repository Structure

.
β”œβ”€β”€ serve.py               # Gradio app entrypoint
β”œβ”€β”€ requirements.txt       # Python dependencies
β”œβ”€β”€ config/
β”‚   └── default.yaml       # sample_rate, n_fft, hop_length, segment_length
└── src/
    └── models/
        └── unet.py        # U-Net architecture definition

βš™οΈ Configuration

  • Model checkpoint is automatically downloaded from the Model Hub:

    https://huggingface.co/theadityamittal/music-separator-unet
    
  • Environment variable CHECKPOINT_PATH may override the default path.


πŸ“„ License

This demo and the model checkpoint are released under the MIT license.


πŸ“ Citation

If you use this demo or the model in your work, please cite:

@misc{music-separator-unet2025,
  title   = {Music Source Separation with U-Net},
  author  = {{Your Name}},
  year    = {2025},
  howpublished = {\url{https://huggingface.co/<YOUR_USERNAME>/music-separator-unet}},
}