qubvel-hf HF Staff commited on
Commit
6ba49bf
·
1 Parent(s): da6a92a

fix division by zero

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -271,7 +271,7 @@ def process_video(
271
  raise ValueError(f"Unsupported video format: {ext}, supported formats: {ALLOWED_VIDEO_EXTENSIONS}")
272
 
273
  video_info = sv.VideoInfo.from_video_path(video_path)
274
- read_each_i_frame = video_info.fps // 25
275
  target_fps = video_info.fps / read_each_i_frame
276
  target_width, target_height = get_target_size(video_info.height, video_info.width, 1080)
277
 
 
271
  raise ValueError(f"Unsupported video format: {ext}, supported formats: {ALLOWED_VIDEO_EXTENSIONS}")
272
 
273
  video_info = sv.VideoInfo.from_video_path(video_path)
274
+ read_each_i_frame = max(1, video_info.fps // 25)
275
  target_fps = video_info.fps / read_each_i_frame
276
  target_width, target_height = get_target_size(video_info.height, video_info.width, 1080)
277