Spaces:
Sleeping
Sleeping
Upload 5 files
Browse files- .gitattributes +2 -0
- app.py +43 -0
- examples/placa_mercosul_1553295403391_v2_900x506.jpg +3 -0
- examples/placabrasil.jpg +0 -0
- examples/placas-vermelhas.jpg +3 -0
- license_plate_detector(1).pt +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
examples/placa_mercosul_1553295403391_v2_900x506.jpg filter=lfs diff=lfs merge=lfs -text
|
37 |
+
examples/placas-vermelhas.jpg filter=lfs diff=lfs merge=lfs -text
|
app.py
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
from ultralytics import ASSETS, YOLO
|
4 |
+
|
5 |
+
model = YOLO("/content/license_plate_detector.pt")
|
6 |
+
|
7 |
+
|
8 |
+
def predict_image(img, conf_threshold, iou_threshold):
|
9 |
+
"""Predicts objects in an image using a YOLO11 model with adjustable confidence and IOU thresholds."""
|
10 |
+
results = model.predict(
|
11 |
+
source=img,
|
12 |
+
conf=conf_threshold,
|
13 |
+
iou=iou_threshold,
|
14 |
+
show_labels=True,
|
15 |
+
show_conf=True,
|
16 |
+
imgsz=640,
|
17 |
+
)
|
18 |
+
|
19 |
+
for r in results:
|
20 |
+
im_array = r.plot()
|
21 |
+
im = Image.fromarray(im_array[..., ::-1])
|
22 |
+
|
23 |
+
return im
|
24 |
+
|
25 |
+
title='License Plate Detector 🚗'
|
26 |
+
description='A license plate detector model fine-tuned from Ultralytics Yolov11'
|
27 |
+
|
28 |
+
iface = gr.Interface(
|
29 |
+
fn=predict_image,
|
30 |
+
inputs=[
|
31 |
+
gr.Image(type="pil", label="Upload Image"),
|
32 |
+
gr.Slider(minimum=0, maximum=1, value=0.25, label="Confidence threshold"),
|
33 |
+
gr.Slider(minimum=0, maximum=1, value=0.45, label="IoU threshold"),
|
34 |
+
],
|
35 |
+
outputs=gr.Image(type="pil", label="Result"),
|
36 |
+
title="Ultralytics Gradio",
|
37 |
+
description="Upload images for inference. The Ultralytics YOLO11n model is used by default.",
|
38 |
+
examples=examples,
|
39 |
+
flagging_mode='never'
|
40 |
+
)
|
41 |
+
|
42 |
+
if __name__ == "__main__":
|
43 |
+
iface.launch()
|
examples/placa_mercosul_1553295403391_v2_900x506.jpg
ADDED
![]() |
Git LFS Details
|
examples/placabrasil.jpg
ADDED
![]() |
examples/placas-vermelhas.jpg
ADDED
![]() |
Git LFS Details
|
license_plate_detector(1).pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0341f5c741a385298512f9616852b59b029a177c2e0a06f22e4a57487fe9c067
|
3 |
+
size 19182483
|