Ahsen Khaliq commited on
Commit
0be0c2f
1 Parent(s): 156bcbf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -11
app.py CHANGED
@@ -1,27 +1,26 @@
1
  import gradio as gr
2
  import os
3
- from pathlib import Path
4
  from scipy.io.wavfile import write
5
 
6
-
7
  def inference(audio):
8
  os.makedirs("out", exist_ok=True)
9
- #oldext = os.path.splitext(audio)[1]
10
- #os.rename(audio.name, "audio" + oldext)
11
  write('test.wav', audio[0], audio[1])
12
  os.system("python3 -m demucs.separate -n demucs48_hq -d cpu test.wav -o out")
13
- #audioname = Path(audio.name).stem
14
- return "./out/demucs48_hq/test/vocals.wav"
15
 
16
- title = "Anime2Sketch"
17
- description = "demo for Anime2Sketch. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
18
- article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2104.05703'>Adversarial Open Domain Adaption for Sketch-to-Photo Synthesis</a> | <a href='https://github.com/Mukosame/Anime2Sketch'>Github Repo</a></p>"
19
 
 
20
  gr.Interface(
21
  inference,
22
  [gr.inputs.Audio(type="numpy", label="Input")],
23
- gr.outputs.Audio(type="file", label="Output"),
24
  title=title,
25
  description=description,
26
- article=article
 
 
27
  ).launch(debug=True)
 
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 demucs48_hq -d cpu test.wav -o out")
9
+ return "./out/demucs48_hq/test/vocals.wav","./out/demucs48_hq/test/bass.wav",
10
+ "./out/demucs48_hq/test/drums.wav","./out/demucs48_hq/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."
14
+ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/1911.13254'>Music Source Separation in the Waveform Domain</a> | <a href='https://github.com/facebookresearch/demucs'>Github Repo</a></p>"
15
 
16
+ examples=['test.mp3']
17
  gr.Interface(
18
  inference,
19
  [gr.inputs.Audio(type="numpy", label="Input")],
20
+ [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")],
21
  title=title,
22
  description=description,
23
+ article=article,
24
+ examples=examples,
25
+ enable_queue=True
26
  ).launch(debug=True)