TashiKP commited on
Commit
4aa08db
·
verified ·
1 Parent(s): 6ba0a10

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,7 +8,7 @@ from datetime import datetime
8
  model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt')
9
 
10
  def detect_video(video):
11
- cap = cv2.VideoCapture(video.name)
12
 
13
  # List to hold results
14
  detection_results = []
@@ -39,7 +39,7 @@ def detect_video(video):
39
 
40
  # Gradio Interface
41
  interface = gr.Interface(fn=detect_video,
42
- inputs=gr.Video(), # Removed 'type' argument
43
  outputs="json",
44
  live=True,
45
  title="YOLOv5 Video Object Detection",
 
8
  model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt')
9
 
10
  def detect_video(video):
11
+ cap = cv2.VideoCapture(video) # Directly use the video path
12
 
13
  # List to hold results
14
  detection_results = []
 
39
 
40
  # Gradio Interface
41
  interface = gr.Interface(fn=detect_video,
42
+ inputs=gr.Video(), # Correct input
43
  outputs="json",
44
  live=True,
45
  title="YOLOv5 Video Object Detection",