File size: 554 Bytes
a8d57c0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b555fe0
a8d57c0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
import yolov5

# load model
model = yolov5.load('keremberke/yolov5m-license-plate')

# set model parameters
model.conf = 0.5  # NMS confidence threshold
model.iou = 0.25  # NMS IoU threshold
model.agnostic = False  # NMS class-agnostic
model.multi_label = False  # NMS multiple labels per box
model.max_det = 1000  # maximum number of detections per image

def greet(img):
    results = model(img, size=640)

    return "Hello " + str(results.pred) + "!!"

iface = gr.Interface(fn=greet, inputs="image", outputs="text")
iface.launch()