nagasurendra commited on
Commit
33ab799
·
verified ·
1 Parent(s): 9b73d76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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
- # Read the uploaded video file
12
- input_video = cv2.VideoCapture(video.name) # 'video' here is the uploaded video file
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))