fffiloni commited on
Commit
a24c898
·
verified ·
1 Parent(s): c2a1297

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -113,9 +113,12 @@ def video_vision(video_input_path, prompt, video_interval):
113
  original_fps = cap.get(cv2.CAP_PROP_FPS)
114
 
115
  frame_skip_factor = video_interval
116
-
117
  # Calculate new FPS
118
- new_fps = original_fps / frame_skip_factor
 
 
 
119
 
120
  vid_frames, image_paths = read_video(video_input_path, video_interval)
121
  # create a question (<image> is a placeholder for the video frames)
 
113
  original_fps = cap.get(cv2.CAP_PROP_FPS)
114
 
115
  frame_skip_factor = video_interval
116
+ new_fps = None
117
  # Calculate new FPS
118
+ if video_interval == 1:
119
+ new_fps = original_fps
120
+ else:
121
+ new_fps = original_fps / frame_skip_factor
122
 
123
  vid_frames, image_paths = read_video(video_input_path, video_interval)
124
  # create a question (<image> is a placeholder for the video frames)