yoyololicon commited on
Commit
7ca4301
1 Parent(s): 00c7899

feat: use app from demucs

Browse files
Files changed (1) hide show
  1. app.py +23 -4
app.py CHANGED
@@ -1,9 +1,28 @@
 
1
  import gradio as gr
 
2
 
3
 
4
- def greet(name):
5
- return "Hello " + name + "!!"
 
 
 
 
6
 
7
 
8
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
9
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
  import gradio as gr
3
+ from scipy.io.wavfile import write
4
 
5
 
6
+ def inference(audio):
7
+ os.makedirs("out", exist_ok=True)
8
+ write('test.wav', audio[0], audio[1])
9
+ os.system("danna_sep --outdir out test.wav")
10
+ return "./out/test_vocals.wav", "./out/test_bass.wav",\
11
+ "./out/test_drums.wav", "./out/test_other.wav"
12
 
13
 
14
+ title = "Danna-Sep"
15
+ description = "Gradio demo for Danna-Sep: Unite to separate them all. To use it, simply upload your audio, or click one of the examples to load them. Read more at the links below."
16
+ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2112.03752' target='_blank'>Danna-Sep: Unite to separate them all</a> | <a href='https://github.com/yoyololicon/danna-sep' target='_blank'>Github Repo</a></p>"
17
+
18
+ examples = []
19
+ gr.Interface(
20
+ inference,
21
+ gr.inputs.Audio(type="numpy", label="Input"),
22
+ [gr.outputs.Audio(type="file", label="Vocals"), gr.outputs.Audio(type="file", label="Bass"), gr.outputs.Audio(
23
+ type="file", label="Drums"), gr.outputs.Audio(type="file", label="Other")],
24
+ title=title,
25
+ description=description,
26
+ article=article,
27
+ examples=examples
28
+ ).launch(enable_queue=True)