Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from ultralytics import YOLO
|
| 2 |
+
import gradio as gr
|
| 3 |
+
from PIL import Image
|
| 4 |
+
|
| 5 |
+
model = YOLO('yolov5s.pt')
|
| 6 |
+
|
| 7 |
+
def detect_plate(image):
|
| 8 |
+
results = model(image)
|
| 9 |
+
annotated_image = results[0].plot()
|
| 10 |
+
return Image.fromarray(annotated_image)
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
iface = gr.Interface(
|
| 14 |
+
fn=detect_plate,
|
| 15 |
+
inputs=gr.Image(type="pil"),
|
| 16 |
+
outputs="image",
|
| 17 |
+
title="Detec莽茫o de Placas de Autom贸veis",
|
| 18 |
+
description="Fa莽a upload de uma imagem para detectar placas de autom贸veis usando o modelo YOLOv5."
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
iface.launch(share=True)
|