File size: 436 Bytes
fe8d4b1
 
 
 
 
 
 
 
 
37daef5
fe8d4b1
 
 
 
 
 
 
 
 
 
 
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 (7).pt')

def predict_image(img): 
        
  model = YOLO('best (7).pt')
  result = model.predict(img,conf=0.97)
  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')