Reuse smooth mask
Browse files
app.py
CHANGED
|
@@ -125,7 +125,7 @@ def crop_signature(original_image_path, mask, padding=32):
|
|
| 125 |
|
| 126 |
# Create an RGBA image with a black background and the denoised mask as the alpha channel
|
| 127 |
mask_image = Image.new('RGBA', (w_padded, h_padded), (0, 0, 0))
|
| 128 |
-
pil_mask = Image.fromarray(
|
| 129 |
mask_image.putalpha(pil_mask)
|
| 130 |
|
| 131 |
return mask_image
|
|
|
|
| 125 |
|
| 126 |
# Create an RGBA image with a black background and the denoised mask as the alpha channel
|
| 127 |
mask_image = Image.new('RGBA', (w_padded, h_padded), (0, 0, 0))
|
| 128 |
+
pil_mask = Image.fromarray(smooth_denoised_mask).convert('L')
|
| 129 |
mask_image.putalpha(pil_mask)
|
| 130 |
|
| 131 |
return mask_image
|