oguzakif commited on
Commit
dbad87c
·
1 Parent(s): 760b3f9

safety check added to get_first_frame

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -201,6 +201,8 @@ def inpaint_video(original_frame_list, mask_list, in_fps, dt_string):
201
 
202
 
203
  def get_first_frame(video):
 
 
204
  video_capture = cv2.VideoCapture()
205
  if video_capture.open(video):
206
  width, height = int(video_capture.get(cv2.CAP_PROP_FRAME_WIDTH)), int(
 
201
 
202
 
203
  def get_first_frame(video):
204
+ if(video == None):
205
+ return gr.ImageMask()
206
  video_capture = cv2.VideoCapture()
207
  if video_capture.open(video):
208
  width, height = int(video_capture.get(cv2.CAP_PROP_FRAME_WIDTH)), int(