Ahsen Khaliq commited on
Commit
cdc4f20
1 Parent(s): 3f2efde

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -0
app.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ os.system("git clone https://github.com/ShuhongChen/bizarre-pose-estimator.git")
3
+ oschdir("bizarre-pose-estimator")
4
+
5
+ os.system("gdown https://drive.google.com/uc?id=1qhnBmMdDTC_8kmNj4u2f_Htfvg6KuE14")
6
+
7
+ os.system("unzip -j bizarre_pose_models.zip")
8
+
9
+ def inference(img):
10
+ os.system("python3 -m _scripts.pose_estimator "+img+" ./_train/character_pose_estim/runs/feat_concat+data.ckpt")
11
+
12
+ return "./_samples/character_pose_estim.png"
13
+
14
+
15
+ title = "Anime2Sketch"
16
+ 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."
17
+ 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>"
18
+
19
+ gr.Interface(
20
+ inference,
21
+ gr.inputs.Image(type="filepath", label="Input"),
22
+ gr.outputs.Image(type="file", label="Output"),
23
+ title=title,
24
+ description=description,
25
+ article=article
26
+ ).launch(debug=True)
27
+