Spaces:
Runtime error
Runtime error
yoyololicon
commited on
Commit
•
60c82d7
1
Parent(s):
6059e95
feat: add fast checkbox
Browse files
app.py
CHANGED
@@ -3,11 +3,14 @@ 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.environ['DANNA_CHECKPOINTS'] = './checkpoints'
|
10 |
-
|
|
|
|
|
|
|
11 |
return "./out/test_vocals.wav", "./out/test_bass.wav",\
|
12 |
"./out/test_drums.wav", "./out/test_other.wav"
|
13 |
|
@@ -19,7 +22,10 @@ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2112.037
|
|
19 |
examples = []
|
20 |
gr.Interface(
|
21 |
inference,
|
22 |
-
|
|
|
|
|
|
|
23 |
[gr.outputs.Audio(type="file", label="Vocals"), gr.outputs.Audio(type="file", label="Bass"), gr.outputs.Audio(
|
24 |
type="file", label="Drums"), gr.outputs.Audio(type="file", label="Other")],
|
25 |
title=title,
|
|
|
3 |
from scipy.io.wavfile import write
|
4 |
|
5 |
|
6 |
+
def inference(audio, is_fast):
|
7 |
os.makedirs("out", exist_ok=True)
|
8 |
write('test.wav', audio[0], audio[1])
|
9 |
os.environ['DANNA_CHECKPOINTS'] = './checkpoints'
|
10 |
+
cmd = "danna_sep --outdir out test.wav"
|
11 |
+
if is_fast:
|
12 |
+
cmd += " --fast"
|
13 |
+
os.system(cmd)
|
14 |
return "./out/test_vocals.wav", "./out/test_bass.wav",\
|
15 |
"./out/test_drums.wav", "./out/test_other.wav"
|
16 |
|
|
|
22 |
examples = []
|
23 |
gr.Interface(
|
24 |
inference,
|
25 |
+
[
|
26 |
+
gr.inputs.Audio(type="numpy", label="Input"),
|
27 |
+
gr.inputs.Checkbox(label="Faster inference without demucs")
|
28 |
+
],
|
29 |
[gr.outputs.Audio(type="file", label="Vocals"), gr.outputs.Audio(type="file", label="Bass"), gr.outputs.Audio(
|
30 |
type="file", label="Drums"), gr.outputs.Audio(type="file", label="Other")],
|
31 |
title=title,
|