Ahsen Khaliq commited on
Commit
2dce12e
1 Parent(s): 3f20767

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio
2
+ import os
3
+ from pathlib import Path
4
+
5
+
6
+ def inference(audio):
7
+ os.mkdir("out")
8
+ os.system("python3 -m demucs.separate -n demucs48_hq -d cpu " +audio.name+" -o out")
9
+ audioname = Path(audio.name).stem
10
+ return "./out/demucs48_hq"+audioname+"/vocals.wav"
11
+
12
+ title = "Anime2Sketch"
13
+ 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."
14
+ 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>"
15
+
16
+ gr.Interface(
17
+ inference,
18
+ [gr.inputs.Audio(type="file", label="Input")],
19
+ gr.outputs.Audio(type="file", label="Output"),
20
+ title=title,
21
+ description=description,
22
+ article=article
23
+ ).launch(debug=True)