ahmedxeno's picture
Rename app (3).py to app.py
f761292
raw
history blame
427 Bytes
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')