Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,8 @@ model = YOLO('./data/model.pt') # Path to your model
|
|
8 |
|
9 |
# Define the function that processes the uploaded video
|
10 |
def process_video(video):
|
11 |
-
#
|
12 |
-
input_video = cv2.VideoCapture(video
|
13 |
|
14 |
# Get frame width, height, and fps from input video
|
15 |
frame_width = int(input_video.get(cv2.CAP_PROP_FRAME_WIDTH))
|
|
|
8 |
|
9 |
# Define the function that processes the uploaded video
|
10 |
def process_video(video):
|
11 |
+
# video is now the file path string, not a file object
|
12 |
+
input_video = cv2.VideoCapture(video) # Directly pass the path to cv2.VideoCapture
|
13 |
|
14 |
# Get frame width, height, and fps from input video
|
15 |
frame_width = int(input_video.get(cv2.CAP_PROP_FRAME_WIDTH))
|