theadityamittal commited on
Commit
ddc5705
Β·
1 Parent(s): acf8aa4

Add Gradio app for music source separation using U-Net model

Browse files
Files changed (2) hide show
  1. README.md +79 -1
  2. 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
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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