freealise commited on
Commit
8d436bc
1 Parent(s): c62a361

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -134,6 +134,9 @@ def make_video(video_path, outdir='./vis_video_depth', encoder='vits', remove_bg
134
  depth_frames = []
135
  orig_frames = []
136
  thumbnail_old = []
 
 
 
137
  while raw_video.isOpened():
138
  ret, raw_frame = raw_video.read()
139
  if not ret:
@@ -203,8 +206,7 @@ def make_video(video_path, outdir='./vis_video_depth', encoder='vits', remove_bg
203
  mask_no_shadow = cv2.inRange(diff_c, np.array([0,0,0]), np.array([16,16,16]))
204
  mask_shadow = cv2.bitwise_not(mask_no_shadow)
205
 
206
- backSub = cv2.createBackgroundSubtractorMOG2()
207
- fgMask = backSub.apply(cv2.cvtColor(raw_frame, cv2.COLOR_BGR2RGB))
208
 
209
  m = cv2.inRange(raw_frame, np.array([255,255,255]), np.array([255,255,255]))
210
  raw_frame[m>0] = (239,239,239)
 
134
  depth_frames = []
135
  orig_frames = []
136
  thumbnail_old = []
137
+
138
+ backSub = cv2.createBackgroundSubtractorMOG2()
139
+
140
  while raw_video.isOpened():
141
  ret, raw_frame = raw_video.read()
142
  if not ret:
 
206
  mask_no_shadow = cv2.inRange(diff_c, np.array([0,0,0]), np.array([16,16,16]))
207
  mask_shadow = cv2.bitwise_not(mask_no_shadow)
208
 
209
+ fgMask = backSub.apply(raw_frame)
 
210
 
211
  m = cv2.inRange(raw_frame, np.array([255,255,255]), np.array([255,255,255]))
212
  raw_frame[m>0] = (239,239,239)