PKaushik commited on
Commit
d552a82
·
1 Parent(s): 58922b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -36,7 +36,7 @@ def fn_video(video_file, conf_thres, iou_thres, start_sec, duration):
36
  out = cv2.VideoWriter(temp_file.name, cv2.VideoWriter_fourcc(*"MP4V"), 60, (1280, 720))
37
 
38
  num_frames = 0
39
- max_frames = duration * 60
40
  while cap.isOpened():
41
  try:
42
  ret, frame = cap.read()
@@ -86,7 +86,7 @@ video_interface = gr.Interface(
86
  gr.Slider(0, 1, value=0.25, label="Confidence Threshold"),
87
  gr.Slider(0, 1, value=0.45, label="IOU Threshold"),
88
  gr.Slider(0, 60, value=0, label="Start Second", step=1),
89
- gr.Slider(0, 60 if pipeline.device.type != 'cpu' else 3, value=4, label="Duration", step=1),
90
  ],
91
  outputs=gr.Video(type="file", format="mp4"),
92
  examples=[
 
36
  out = cv2.VideoWriter(temp_file.name, cv2.VideoWriter_fourcc(*"MP4V"), 60, (1280, 720))
37
 
38
  num_frames = 0
39
+ max_frames = duration * 1
40
  while cap.isOpened():
41
  try:
42
  ret, frame = cap.read()
 
86
  gr.Slider(0, 1, value=0.25, label="Confidence Threshold"),
87
  gr.Slider(0, 1, value=0.45, label="IOU Threshold"),
88
  gr.Slider(0, 60, value=0, label="Start Second", step=1),
89
+ gr.Slider(0, 60 if pipeline.device.type != 'cpu' else 1, value=2, label="Duration", step=1),
90
  ],
91
  outputs=gr.Video(type="file", format="mp4"),
92
  examples=[