File size: 719 Bytes
5ae33d7
0bc27e7
 
 
5ae33d7
825f4db
0bc27e7
 
5ae33d7
0bc27e7
 
 
 
 
 
 
fa8ec73
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
from visualization import visualization
# pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
# pipeline = pipeline(task="image-classification", model="jhp/hoi")

def predict(image,threshold,topk,device=''):
    vis_img = visualization(image,threshold,topk)
    return vis_img

gr.Interface(
    predict,
    inputs=[gr.Image(type='pil',label="input image"),
           gr.Slider(0, 1, value=0.4, label="Threshold", info="Set detection score threshold between 0~1"),
           gr.Number(value=5,label='Topk',info='Topk prediction')],
    outputs= gr.Image(type="pil", label="hoi detection results"),
    title="HOI detection",
).launch(debug=True,enable_queue=True)