Team Ai
Apppublic

MLVLab/Human_Object_Interaction

sourceHugging Faceapache-2.0updated 3y agoView on Hugging Face
1likes
app.py17 linesDownload Raw Back to root
1import gradio as gr2from visualization import visualization3# pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")4# pipeline = pipeline(task="image-classification", model="jhp/hoi")5 6def predict(image,threshold,topk,device=''):7    vis_img = visualization(image,threshold,topk)8    return vis_img9 10gr.Interface(11    predict,12    inputs=[gr.Image(type='pil',label="input image"),13           gr.Slider(0, 1, value=0.4, label="Threshold", info="Set detection score threshold between 0~1"),14           gr.Number(value=5,label='Topk',info='Topk prediction')],15    outputs= gr.Image(type="pil", label="hoi detection results"),16    title="HOI detection",17).launch(debug=True,enable_queue=True)