freealise commited on
Commit
4411e98
1 Parent(s): 5a87210

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -604,7 +604,7 @@ def draw_mask(l, t, b, v, d, evt: gr.EventData):
604
  x = points[len(points)-1][0]
605
  y = points[len(points)-1][1]
606
 
607
- sel = cv2.floodFill(d["layers"][0], None, (x, y), 1, 2, 2, (4 | cv2.FLOODFILL_FIXED_RANGE))[2] #(4 | cv2.FLOODFILL_FIXED_RANGE | cv2.FLOODFILL_MASK_ONLY | 255 << 8)
608
  # 255 << 8 tells to fill with the value 255)
609
  sel = sel[1:sel.shape[0]-1, 1:sel.shape[1]-1]
610
 
 
604
  x = points[len(points)-1][0]
605
  y = points[len(points)-1][1]
606
 
607
+ 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)
608
  # 255 << 8 tells to fill with the value 255)
609
  sel = sel[1:sel.shape[0]-1, 1:sel.shape[1]-1]
610