prithivMLmods commited on
Commit
53342b7
·
verified ·
1 Parent(s): e412787

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -37,7 +37,7 @@ model_m = Qwen2_5_VLForConditionalGeneration.from_pretrained(
37
 
38
  def downsample_video(video_path):
39
  """
40
- Downsamples the video to 10 evenly spaced frames.
41
  Each frame is returned as a PIL image along with its timestamp.
42
  """
43
  vidcap = cv2.VideoCapture(video_path)
@@ -45,7 +45,7 @@ def downsample_video(video_path):
45
  fps = vidcap.get(cv2.CAP_PROP_FPS)
46
  frames = []
47
  # Sample 10 evenly spaced frames.
48
- frame_indices = np.linspace(0, total_frames - 1, 10, dtype=int)
49
  for i in frame_indices:
50
  vidcap.set(cv2.CAP_PROP_POS_FRAMES, i)
51
  success, image = vidcap.read()
 
37
 
38
  def downsample_video(video_path):
39
  """
40
+ Downsamples the video to evenly spaced frames.
41
  Each frame is returned as a PIL image along with its timestamp.
42
  """
43
  vidcap = cv2.VideoCapture(video_path)
 
45
  fps = vidcap.get(cv2.CAP_PROP_FPS)
46
  frames = []
47
  # Sample 10 evenly spaced frames.
48
+ frame_indices = np.linspace(0, total_frames - 1, 14, dtype=int)
49
  for i in frame_indices:
50
  vidcap.set(cv2.CAP_PROP_POS_FRAMES, i)
51
  success, image = vidcap.read()