sparanoid commited on
Commit
1bc3976
1 Parent(s): 5244b19

feat init repo

Browse files
Files changed (5) hide show
  1. README.md +1 -1
  2. app.py +28 -0
  3. packages.txt +1 -0
  4. requirements.txt +2 -0
  5. test.mp3 +0 -0
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Demucs Gpu
3
  emoji: 🦀
4
  colorFrom: purple
5
  colorTo: purple
 
1
  ---
2
+ title: Demucs GPU
3
  emoji: 🦀
4
  colorFrom: purple
5
  colorTo: purple
app.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+ from scipy.io.wavfile import write
4
+
5
+ def inference(audio):
6
+ os.makedirs("out", exist_ok=True)
7
+ write('test.wav', audio[0], audio[1])
8
+ os.system("python3 -m demucs.separate -n mdx_extra_q -d cpu test.wav -o out")
9
+ return "./out/mdx_extra_q/test/vocals.wav","./out/mdx_extra_q/test/bass.wav",\
10
+ "./out/mdx_extra_q/test/drums.wav","./out/mdx_extra_q/test/other.wav"
11
+
12
+ title = "Demucs"
13
+ description = "Gradio demo for Demucs: Music Source Separation in the Waveform Domain. To use it, simply upload your audio, or click one of the examples to load them. Read more at the links below. This space will be switched to GPU only when I need it :)"
14
+ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/1911.13254' target='_blank'>Music Source Separation in the Waveform Domain</a> | <a href='https://github.com/facebookresearch/demucs' target='_blank'>Github Repo</a></p>"
15
+
16
+ examples=[['test.mp3']]
17
+
18
+ iface = gr.Interface(
19
+ inference,
20
+ gr.inputs.Audio(type="numpy", label="Input"),
21
+ [gr.outputs.Audio(type="file", label="Vocals"),gr.outputs.Audio(type="file", label="Bass"),gr.outputs.Audio(type="file", label="Drums"),gr.outputs.Audio(type="file", label="Other")],
22
+ title=title,
23
+ description=description,
24
+ article=article,
25
+ examples=examples
26
+ )
27
+
28
+ iface.launch(enable_queue=True)
packages.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ ffmpeg
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ demucs
2
+ scipy
test.mp3 ADDED
Binary file (263 kB). View file