jameslahm commited on
Commit
8a29ce7
·
verified ·
1 Parent(s): c06ddc9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -197,9 +197,10 @@ def app():
197
  }
198
  elif visual_prompt_type == "masks":
199
  image, masks = mask_image["background"], mask_image["layers"][0]
200
- image = image.convert("RGB")
201
- masks = np.array(masks.convert("1"))
202
  masks = binary_fill_holes(masks).astype(np.uint8)
 
203
  prompts = {
204
  "masks": masks[None]
205
  }
 
197
  }
198
  elif visual_prompt_type == "masks":
199
  image, masks = mask_image["background"], mask_image["layers"][0]
200
+ # image = image.convert("RGB")
201
+ masks = np.array(masks.convert("L"))
202
  masks = binary_fill_holes(masks).astype(np.uint8)
203
+ masks[masks > 0] = 1
204
  prompts = {
205
  "masks": masks[None]
206
  }