Ahsen Khaliq commited on
Commit
5842467
·
1 Parent(s): db24995

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+
4
+ def inference(image):
5
+ os.system("python -m openpifpaf.predict "+image.name+" --checkpoint=shufflenetv2k30-wholebody --line-width=2 -o out.jpg")
6
+ return "out.jpg"
7
+
8
+
9
+ title = "Keypoint Communities"
10
+ description = "Gradio demo for Keypoint Communities. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
11
+ 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>"
12
+
13
+ gr.Interface(
14
+ inference,
15
+ gr.inputs.Image(type="file", label="Input"),
16
+ gr.outputs.Image(type="file", label="Output"),
17
+ title=title,
18
+ description=description,
19
+ article=article,
20
+ enable_queue=True
21
+ ).launch(debug=True)