import gradio as gr import os def inference(image): os.system("""python -m openpifpaf.predict """+ image.name+""" \ --checkpoint=shufflenetv2k16-apollo-24 -o out.jpg \ --instance-threshold 0.05 --seed-threshold 0.05 \ --line-width 4 --font-size 0""") return "out.jpg" title = "Keypoint Communities" 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." article = "

Keypoint Communities | Github Repo

" examples=[['soccer.jpeg']] gr.Interface( inference, gr.inputs.Image(type="file", label="Input"), gr.outputs.Image(type="file", label="Output"), title=title, description=description, article=article, enable_queue=True, examples=examples ).launch(debug=True)