Spaces:
Sleeping
Sleeping
File size: 427 Bytes
4ae08c7 f761292 4ae08c7 f761292 4ae08c7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import gradio as gr
import cv2
import numpy as np
from ultralytics import YOLO
model = YOLO('best.pt')
def predict_image(img):
model = YOLO('best.pt')
result = model.predict(img,conf=0.9)
res_plotted = result[0].plot()
#cv2.imshow( res_plotted)
return res_plotted
image = gr.inputs.Image()
label = gr.outputs.Label('ok')
gr.Interface(fn=predict_image, inputs=image, outputs=image).launch(debug='True') |