yonigozlan HF Staff commited on
Commit
45ae07f
·
1 Parent(s): b76929b

change max video length

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -29,7 +29,7 @@ LABEL_ANNOTATOR = sv.LabelAnnotator()
29
 
30
  def calculate_end_frame_index(source_video_path):
31
  video_info = sv.VideoInfo.from_video_path(source_video_path)
32
- return min(video_info.total_frames, video_info.fps * 2)
33
 
34
 
35
  def annotate_image(input_image, detections, labels) -> np.ndarray:
@@ -128,7 +128,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
128
  with gr.Column():
129
  input_video = gr.Video(label="Input Video")
130
  with gr.Column():
131
- output_video = gr.Video(label="Output Video")
132
  actual_fps = gr.Markdown("", visible=False)
133
  with gr.Row():
134
  classes = gr.Textbox(
 
29
 
30
  def calculate_end_frame_index(source_video_path):
31
  video_info = sv.VideoInfo.from_video_path(source_video_path)
32
+ return min(video_info.total_frames, video_info.fps * 5)
33
 
34
 
35
  def annotate_image(input_image, detections, labels) -> np.ndarray:
 
128
  with gr.Column():
129
  input_video = gr.Video(label="Input Video")
130
  with gr.Column():
131
+ output_video = gr.Video(label="Output Video (5s max)")
132
  actual_fps = gr.Markdown("", visible=False)
133
  with gr.Row():
134
  classes = gr.Textbox(