Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -201,13 +201,14 @@ def make_video(video_path, outdir='./vis_video_depth', encoder='vits', remove_bg
|
|
201 |
|
202 |
mask_bg = cv2.inRange(diff_d, np.array([0,0,0]), np.array([16,16,16]))
|
203 |
mask_no_shadow = cv2.inRange(diff_c, np.array([0,0,0]), np.array([16,16,16]))
|
|
|
204 |
|
205 |
depth_gray[cv2.bitwise_and(mask_no_shadow, mask_bg)>0] = 0
|
206 |
depth_color[cv2.bitwise_and(mask_no_shadow, mask_bg)>0] = (0,0,0)
|
207 |
|
208 |
m = cv2.inRange(raw_frame, np.array([255,255,255]), np.array([255,255,255]))
|
209 |
-
raw_frame[m>0] = (
|
210 |
-
raw_frame[
|
211 |
raw_frame[cv2.bitwise_and(mask_no_shadow, mask_bg)>0] = (255,255,255)
|
212 |
|
213 |
cv2.imwrite(f"f{count}.png", raw_frame)
|
|
|
201 |
|
202 |
mask_bg = cv2.inRange(diff_d, np.array([0,0,0]), np.array([16,16,16]))
|
203 |
mask_no_shadow = cv2.inRange(diff_c, np.array([0,0,0]), np.array([16,16,16]))
|
204 |
+
mask_shadow = mask_bg[mask_no_shadow==0]
|
205 |
|
206 |
depth_gray[cv2.bitwise_and(mask_no_shadow, mask_bg)>0] = 0
|
207 |
depth_color[cv2.bitwise_and(mask_no_shadow, mask_bg)>0] = (0,0,0)
|
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)
|
211 |
+
raw_frame[mask_shadow>0] = int(raw_frame / 17 + 240)
|
212 |
raw_frame[cv2.bitwise_and(mask_no_shadow, mask_bg)>0] = (255,255,255)
|
213 |
|
214 |
cv2.imwrite(f"f{count}.png", raw_frame)
|