23b719w commited on
Commit
70b15cf
1 Parent(s): 17ae86d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -51,7 +51,7 @@ def predict(pilimg,video_in_filepath,threshold):
51
  if pilimg:
52
  image_np = pil_image_as_numpy_array(pilimg)
53
  return predict2(image_np,threshold),None
54
- else:
55
  video_reader = cv2.VideoCapture(video_in_filepath)
56
 
57
  nb_frames = int(video_reader.get(cv2.CAP_PROP_FRAME_COUNT))
@@ -91,7 +91,8 @@ def predict(pilimg,video_in_filepath,threshold):
91
  cv2.destroyAllWindows()
92
  cv2.waitKey(1)
93
  return None,video_out_filepath
94
-
 
95
 
96
 
97
  def predict2(image_np,threshold):
 
51
  if pilimg:
52
  image_np = pil_image_as_numpy_array(pilimg)
53
  return predict2(image_np,threshold),None
54
+ elif video_in_filepath:
55
  video_reader = cv2.VideoCapture(video_in_filepath)
56
 
57
  nb_frames = int(video_reader.get(cv2.CAP_PROP_FRAME_COUNT))
 
91
  cv2.destroyAllWindows()
92
  cv2.waitKey(1)
93
  return None,video_out_filepath
94
+ else:
95
+ return None, None
96
 
97
 
98
  def predict2(image_np,threshold):