DeteccaoPlaca / app.py
matheuscervantes55's picture
Update app.py
39f519f verified
raw
history blame contribute delete
520 Bytes
from ultralytics import YOLO
import gradio as gr
from PIL import Image
model = YOLO('yolov5s.pt')
def detect_plate(image):
results = model(image)
annotated_image = results[0].plot()
return Image.fromarray(annotated_image)
iface = gr.Interface(
fn=detect_plate,
inputs=gr.Image(type="pil"),
outputs="image",
title="Detec莽茫o de Placas de Autom贸veis",
description="Fa莽a upload de uma imagem para detectar placas de autom贸veis usando o modelo YOLOv5."
)
iface.launch(share=True)