File size: 406 Bytes
704b89e
 
 
 
f6d54d0
704b89e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import cv2
import gradio as gr
from ultralytics import YOLO

model = YOLO("best.pt")

def predict(img):

    pred = model(img)
    frame_with_bbox = pred[0].plot()
    return frame_with_bbox



gradio_app = gr.Interface(
             fn=predict,
             inputs=gr.Image(type="numpy"),
             outputs=gr.Image(type="numpy"))

if __name__ == "__main__":
    gradio_app.launch()