Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
import cv2
|
| 3 |
-
import torch
|
| 4 |
|
| 5 |
-
model =
|
| 6 |
|
| 7 |
-
def
|
| 8 |
-
results = model(image)
|
| 9 |
-
return results.
|
| 10 |
|
| 11 |
gr.Interface(
|
| 12 |
-
fn=
|
| 13 |
inputs=gr.Image(type="numpy"),
|
| 14 |
outputs=gr.Image(type="numpy"),
|
| 15 |
-
title="Vehicle Detection"
|
| 16 |
).launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from ultralytics import YOLO
|
| 3 |
import cv2
|
|
|
|
| 4 |
|
| 5 |
+
model = YOLO("last.pt")
|
| 6 |
|
| 7 |
+
def predict(image):
|
| 8 |
+
results = model(image)[0]
|
| 9 |
+
return results.plot()
|
| 10 |
|
| 11 |
gr.Interface(
|
| 12 |
+
fn=predict,
|
| 13 |
inputs=gr.Image(type="numpy"),
|
| 14 |
outputs=gr.Image(type="numpy"),
|
| 15 |
+
title="Vehicle Detection App"
|
| 16 |
).launch()
|