Update
Browse files- .gitignore +2 -0
- app.py +10 -7
.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
main.py
|
2 |
+
video.mp4
|
app.py
CHANGED
@@ -3,12 +3,15 @@ from ultralytics import YOLO
|
|
3 |
|
4 |
def run(source):
|
5 |
global model
|
6 |
-
|
7 |
-
|
|
|
|
|
8 |
model = YOLO("yolov8n-nckh2023.pt") # Select YOLO model
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
12 |
outputs=gr.Image(shape=[256,256], elem_id="output_image").style(width=256, height=256),
|
13 |
-
title="Motorcyclist, helmet, and license plate detection"
|
14 |
-
|
|
|
3 |
|
4 |
def run(source):
|
5 |
global model
|
6 |
+
res = model(source)
|
7 |
+
res_plotted = res[0].plot()
|
8 |
+
return res_plotted
|
9 |
+
|
10 |
model = YOLO("yolov8n-nckh2023.pt") # Select YOLO model
|
11 |
+
|
12 |
+
gr.Interface(
|
13 |
+
predict,
|
14 |
+
inputs=gr.inputs.Image(label="Upload hot dog candidate", type="filepath"),
|
15 |
outputs=gr.Image(shape=[256,256], elem_id="output_image").style(width=256, height=256),
|
16 |
+
title="Motorcyclist, helmet, and license plate detection",
|
17 |
+
).launch()
|