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)