freealise commited on
Commit
12e552d
1 Parent(s): 328e50b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -159,8 +159,8 @@ def make_video(video_path, outdir='./vis_video_depth', encoder='vits'):
159
  # change image to black where we found white
160
  depth_gray[mask>0] = 0
161
 
162
- mask = cv2.inRange(depth_gray[int(depth_gray.shape[0]/8*6.5):depth_gray.shape[0]-1, 0:depth_gray.shape[1]], 160, 255)
163
- depth_gray[int(depth_gray.shape[0]/8*6.5):depth_gray.shape[0]-1, 0:depth_gray.shape[1]][mask>0] = 160
164
 
165
  depth_color = cv2.cvtColor(depth_gray, cv2.COLOR_GRAY2BGR)
166
  # split_region = np.ones((frame_height, margin_width, 3), dtype=np.uint8) * 255
@@ -549,8 +549,9 @@ def draw_mask(l, t, v, d, evt: gr.EventData):
549
 
550
  x = points[len(points)-1][0]
551
  y = points[len(points)-1][1]
552
-
553
- mask = cv2.floodFill(bg, None, (x, y), 1, 0, int(t*256/l), (4 | cv2.FLOODFILL_FIXED_RANGE))[2] #(4 | cv2.FLOODFILL_FIXED_RANGE | cv2.FLOODFILL_MASK_ONLY | 255 << 8)
 
554
  # 255 << 8 tells to fill with the value 255)
555
  mask = mask[1:mask.shape[0]-1, 1:mask.shape[1]-1]
556
 
 
159
  # change image to black where we found white
160
  depth_gray[mask>0] = 0
161
 
162
+ mask = cv2.inRange(depth_gray[int(depth_gray.shape[0]/8*6.5):depth_gray.shape[0], 0:depth_gray.shape[1]], 160, 255)
163
+ depth_gray[int(depth_gray.shape[0]/8*6.5):depth_gray.shape[0], 0:depth_gray.shape[1]][mask>0] = 160
164
 
165
  depth_color = cv2.cvtColor(depth_gray, cv2.COLOR_GRAY2BGR)
166
  # split_region = np.ones((frame_height, margin_width, 3), dtype=np.uint8) * 255
 
549
 
550
  x = points[len(points)-1][0]
551
  y = points[len(points)-1][1]
552
+
553
+ #int(t*256/l)
554
+ mask = cv2.floodFill(bg, None, (x, y), 1, 0, 256, (4 | cv2.FLOODFILL_FIXED_RANGE))[2] #(4 | cv2.FLOODFILL_FIXED_RANGE | cv2.FLOODFILL_MASK_ONLY | 255 << 8)
555
  # 255 << 8 tells to fill with the value 255)
556
  mask = mask[1:mask.shape[0]-1, 1:mask.shape[1]-1]
557