Ahsen Khaliq commited on
Commit
221b8fe
1 Parent(s): d310a6a

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 as gr
2
+ import os
3
+
4
+ def inference(image):
5
+ os.system("""python -m openpifpaf.predict """+ image.name+""" \
6
+ --checkpoint=shufflenetv2k16-apollo-24 -o out.jpg \
7
+ --instance-threshold 0.05 --seed-threshold 0.05 \
8
+ --line-width 4 --font-size 0""")
9
+ return "out.jpg"
10
+ title = "Keypoint Communities"
11
+ description = "Gradio demo for Keypoint Communities: a fast bottom-up method that jointly detects over 100 keypoints on humans or objects, also referred to as human/object pose estimation. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
12
+ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2110.00988' target='_blank'>Keypoint Communities</a> | <a href='https://github.com/DuncanZauss/Keypoint_Communities' target='_blank'>Github Repo</a></p>"
13
+ examples=[['soccer.jpeg']]
14
+ gr.Interface(
15
+ inference,
16
+ gr.inputs.Image(type="file", label="Input"),
17
+ gr.outputs.Image(type="file", label="Output"),
18
+ title=title,
19
+ description=description,
20
+ article=article,
21
+ enable_queue=True,
22
+ examples=examples
23
+ ).launch(debug=True)