File size: 1,125 Bytes
221b8fe
 
 
 
 
 
 
 
 
b03ebab
 
 
 
221b8fe
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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 = "OpenPifPaf"
description = "Gradio demo for OpenPifPaf: Composite Fields for Semantic Keypoint Detection and Spatio-Temporal Association. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
article = "<p style='text-align: center'><a href='https://openpifpaf.github.io/intro.html' target='_blank'>OpenPifPaf: Composite Fields for Semantic Keypoint Detection and Spatio-Temporal Association</a> | <a href='https://github.com/openpifpaf/openpifpaf' target='_blank'>Github Repo</a></p>"
examples=[['cars.png']]
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)