aryswisnu commited on
Commit
3166f93
1 Parent(s): fb65895

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -65,12 +65,13 @@ def extract_image(img, pos_prompts, neg_prompts, threshold, alpha_value=0.5):
65
 
66
  # apply the final_mask as alpha channel on the output image
67
  output_image[:, :, :3] = img_np[:, :, :3]
68
- output_image[:, :, 3] = (final_mask * 255 * alpha_value).astype(np.uint8)
69
 
70
  # convert the output_image back to a PIL.Image object
71
  output_image = Image.fromarray(output_image, "RGBA")
72
 
73
- return output_image, final_mask, bmask
 
74
 
75
 
76
 
 
65
 
66
  # apply the final_mask as alpha channel on the output image
67
  output_image[:, :, :3] = img_np[:, :, :3]
68
+ output_image[:, :, 3] = (final_mask * alpha_value * 255).astype(np.uint8)
69
 
70
  # convert the output_image back to a PIL.Image object
71
  output_image = Image.fromarray(output_image, "RGBA")
72
 
73
+ return output_image, final_mask.astype(np.uint8), bmask
74
+
75
 
76
 
77