Spaces:
Sleeping
Sleeping
Commit Β·
ddc5705
1
Parent(s): acf8aa4
Add Gradio app for music source separation using U-Net model
Browse files- README.md +79 -1
- serve.py β app.py +0 -0
README.md
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
---
|
| 2 |
title: Music Separator Space
|
| 3 |
emoji: π»
|
|
@@ -10,4 +11,81 @@ pinned: false
|
|
| 10 |
license: mit
|
| 11 |
---
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
---
|
| 3 |
title: Music Separator Space
|
| 4 |
emoji: π»
|
|
|
|
| 11 |
license: mit
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# π΅ Music Source Separation Demo
|
| 15 |
+
|
| 16 |
+
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.
|
| 17 |
+
|
| 18 |
+
π Try it live: https://huggingface.co/spaces/theadityamittal/music-separator-space
|
| 19 |
+
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
## π οΈ How It Works
|
| 23 |
+
|
| 24 |
+
1. **Upload** your mixture `.wav` (16 kHz mono).
|
| 25 |
+
2. Internally, we compute an STFT and split it into fixed-length segments.
|
| 26 |
+
3. A U-Net predicts magnitude masks for each source.
|
| 27 |
+
4. We reconstruct each stem via inverse STFT using the original phase.
|
| 28 |
+
5. Download your separated stems!
|
| 29 |
+
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
## π§ Installation (Local)
|
| 33 |
+
|
| 34 |
+
If you want to run it locally instead of on the Space:
|
| 35 |
+
|
| 36 |
+
```
|
| 37 |
+
git clone https://huggingface.co/spaces/theadityamittal/music-separator-space
|
| 38 |
+
cd music-separator-space
|
| 39 |
+
python3 -m venv venv && source venv/bin/activate
|
| 40 |
+
pip install -r requirements.txt
|
| 41 |
+
python serve.py
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
Then open [http://localhost:7860](http://localhost:7860) in your browser.
|
| 45 |
+
|
| 46 |
+
---
|
| 47 |
+
|
| 48 |
+
## ποΈ Repository Structure
|
| 49 |
+
|
| 50 |
+
```
|
| 51 |
+
.
|
| 52 |
+
βββ serve.py # Gradio app entrypoint
|
| 53 |
+
βββ requirements.txt # Python dependencies
|
| 54 |
+
βββ config/
|
| 55 |
+
β βββ default.yaml # sample_rate, n_fft, hop_length, segment_length
|
| 56 |
+
βββ src/
|
| 57 |
+
βββ models/
|
| 58 |
+
βββ unet.py # U-Net architecture definition
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
---
|
| 62 |
+
|
| 63 |
+
## βοΈ Configuration
|
| 64 |
+
|
| 65 |
+
* **Model checkpoint** is automatically downloaded from the Model Hub:
|
| 66 |
+
|
| 67 |
+
```
|
| 68 |
+
https://huggingface.co/theadityamittal/music-separator-unet
|
| 69 |
+
```
|
| 70 |
+
* **Environment variable** `CHECKPOINT_PATH` may override the default path.
|
| 71 |
+
|
| 72 |
+
---
|
| 73 |
+
|
| 74 |
+
## π License
|
| 75 |
+
|
| 76 |
+
This demo and the model checkpoint are released under the **MIT license**.
|
| 77 |
+
|
| 78 |
+
---
|
| 79 |
+
|
| 80 |
+
## π Citation
|
| 81 |
+
|
| 82 |
+
If you use this demo or the model in your work, please cite:
|
| 83 |
+
|
| 84 |
+
```bibtex
|
| 85 |
+
@misc{music-separator-unet2025,
|
| 86 |
+
title = {Music Source Separation with U-Net},
|
| 87 |
+
author = {{Your Name}},
|
| 88 |
+
year = {2025},
|
| 89 |
+
howpublished = {\url{https://huggingface.co/<YOUR_USERNAME>/music-separator-unet}},
|
| 90 |
+
}
|
| 91 |
+
```
|
serve.py β app.py
RENAMED
|
File without changes
|