Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -212,14 +212,7 @@ def dummy(img):
|
|
212 |
alpha_channel = img["layers"][0][:, :, 3]
|
213 |
mask = np.where(alpha_channel == 0, 0, 255).astype(np.uint8)
|
214 |
|
215 |
-
|
216 |
-
mask_image_pil = Image.fromarray(mask)
|
217 |
-
mask_image_resized = mask_image_pil.resize((composite_width, composite_height), Image.ANTIALIAS)
|
218 |
-
|
219 |
-
# 将调整大小后的蒙版图像转换回 numpy 数组
|
220 |
-
mask_resized = np.array(mask_image_resized)
|
221 |
-
|
222 |
-
return mask_resized
|
223 |
|
224 |
|
225 |
|
|
|
212 |
alpha_channel = img["layers"][0][:, :, 3]
|
213 |
mask = np.where(alpha_channel == 0, 0, 255).astype(np.uint8)
|
214 |
|
215 |
+
return mask
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
|
217 |
|
218 |
|