sigyllly commited on
Commit
9f97f60
1 Parent(s): c11619c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -43,7 +43,7 @@ def extract_image(pos_prompts, neg_prompts, img, threshold):
43
  neg_mask = np.any(np.stack(negative_masks), axis=0)
44
  final_mask = pos_mask & ~neg_mask
45
 
46
- final_mask = Image.fromarray(final_mask.astype(np.uint8) * 255, "L")
47
  output_image = Image.new("RGBA", img.size, (0, 0, 0, 0))
48
  output_image.paste(img, mask=final_mask)
49
  return output_image, final_mask
 
43
  neg_mask = np.any(np.stack(negative_masks), axis=0)
44
  final_mask = pos_mask & ~neg_mask
45
 
46
+ final_mask = Image.fromarray((final_mask * 255).astype(np.uint8), "L")
47
  output_image = Image.new("RGBA", img.size, (0, 0, 0, 0))
48
  output_image.paste(img, mask=final_mask)
49
  return output_image, final_mask