npc0's picture
Update app.py
b555fe0
raw history blame
No virus
554 Bytes
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()