Lasion commited on
Commit
718657d
1 Parent(s): 343e9ef
Files changed (2) hide show
  1. .gitignore +2 -0
  2. 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
- return model.predict(source=frame, conf=.5, iou=.5, stream=False, save=True, show=False)
7
-
 
 
8
  model = YOLO("yolov8n-nckh2023.pt") # Select YOLO model
9
- iface = gr.Interface(
10
- fn=run,
11
- inputs=gr.inputs.Image(label="Upload a image or video", type="filepath"),
 
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
- iface.launch()
 
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()