Spaces:
Running
Running
Tashi Kuenga Phuntsho
commited on
Commit
·
3950ee5
1
Parent(s):
47094b3
added model
Browse files
app.py
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from ultralytics import YOLO
|
| 2 |
import gradio as gr
|
| 3 |
+
from PIL import Image
|
| 4 |
|
| 5 |
+
model = YOLO("best.pt")
|
| 6 |
+
def detect_potholes(image):
|
| 7 |
+
results = model(image)
|
| 8 |
+
annotated_frame = results[0].plot()
|
| 9 |
+
return Image.fromarray(annotated_frame)
|
| 10 |
|
| 11 |
+
iface = gr.Interface(
|
| 12 |
+
fn=detect_potholes,
|
| 13 |
+
inputs=gr.inputs.Image(type="pil"),
|
| 14 |
+
outputs="image",
|
| 15 |
+
title="Pothole Detector"
|
| 16 |
+
)
|
| 17 |
+
|
| 18 |
+
iface.launch()
|
best.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d1f412a973ee53e0ababd1902c11c38c4655f0ce361d4480399599239ff54342
|
| 3 |
+
size 14389032
|