freealise commited on
Commit
0b4b4f5
·
verified ·
1 Parent(s): e982d47

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -226,6 +226,7 @@ def make_video(video_path, outdir='./vis_video_depth', encoder='vits', blur_data
226
  depth_frames.append(f"f{count}_dmap.png")
227
 
228
  depth_gray = seg_frame(depth_gray) + 128
 
229
 
230
  cv2.imwrite(f"f{count}_mask.png", depth_gray)
231
  masks.append(f"f{count}_mask.png")
@@ -604,6 +605,7 @@ def draw_mask(l, t, b, v, d, evt: gr.EventData):
604
 
605
  mask = cv2.imread(masks[frame_selected], cv2.IMREAD_GRAYSCALE).astype(np.uint8)
606
  mask[mask==128] = 0
 
607
  d["layers"][0] = cv2.cvtColor(mask, cv2.COLOR_GRAY2RGBA)
608
 
609
  sel = cv2.floodFill(mask, None, (x, y), 1, 2, 2, (4 | cv2.FLOODFILL_FIXED_RANGE))[2] #(4 | cv2.FLOODFILL_FIXED_RANGE | cv2.FLOODFILL_MASK_ONLY | 255 << 8)
 
226
  depth_frames.append(f"f{count}_dmap.png")
227
 
228
  depth_gray = seg_frame(depth_gray) + 128
229
+ print(depth_gray[depth_gray>128]-128)
230
 
231
  cv2.imwrite(f"f{count}_mask.png", depth_gray)
232
  masks.append(f"f{count}_mask.png")
 
605
 
606
  mask = cv2.imread(masks[frame_selected], cv2.IMREAD_GRAYSCALE).astype(np.uint8)
607
  mask[mask==128] = 0
608
+ print(mask[mask>0]-128)
609
  d["layers"][0] = cv2.cvtColor(mask, cv2.COLOR_GRAY2RGBA)
610
 
611
  sel = cv2.floodFill(mask, None, (x, y), 1, 2, 2, (4 | cv2.FLOODFILL_FIXED_RANGE))[2] #(4 | cv2.FLOODFILL_FIXED_RANGE | cv2.FLOODFILL_MASK_ONLY | 255 << 8)