MTTR commited on
Commit
cd528f3
1 Parent(s): 72b569e

a small bug fix

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -43,11 +43,11 @@ def apply_mask(image, mask, color, transparency=0.7):
43
  return out_image
44
 
45
  def process(text_query, full_video_path):
46
- start_pt, end_pt = 0, 10
47
  input_clip_path = '/tmp/input.mp4'
48
  # extract the relevant subclip:
49
  with VideoFileClip(full_video_path) as video:
50
- subclip = video.subclip(start_pt, end_pt)
51
  subclip.write_videofile(input_clip_path)
52
 
53
  checkpoint_path ='./refer-youtube-vos_window-12.pth.tar'
 
43
  return out_image
44
 
45
  def process(text_query, full_video_path):
46
+ start_pt, max_end_pt = 0, 10
47
  input_clip_path = '/tmp/input.mp4'
48
  # extract the relevant subclip:
49
  with VideoFileClip(full_video_path) as video:
50
+ subclip = video.subclip(start_pt, min(video.duration, max_end_pt))
51
  subclip.write_videofile(input_clip_path)
52
 
53
  checkpoint_path ='./refer-youtube-vos_window-12.pth.tar'