satrn088/Person_Detection
0
1import gradio as gr2from PIL import Image3from ultralytics import YOLO4 5 6source = "best.pt"7model = YOLO(source)8 9def obejct_detection(image, conf, iou):10 results = model(image, conf=conf, iou=iou)11 12 for r in results:13 im_array = r.plot() # plot a BGR numpy array of predictions14 im = Image.fromarray(im_array[..., ::-1])15 16 return im17 18 19interface = gr.Interface(20 obejct_detection,21 [gr.Image(type="pil"),22 gr.Slider(0.1, 0.9, value=0.5, step=0.05, label="confidence"),23 gr.Slider(0.1, 0.9, value=0.25, step=0.05, label="iou")],24 'image'25)26 27interface.launch(share=True)28 29 