Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,11 @@ def process_image(img):
|
|
9 |
mask = np.where(alpha_channel == 0, 0, 255)
|
10 |
|
11 |
# return img["background"], mask
|
12 |
-
|
|
|
|
|
|
|
|
|
13 |
|
14 |
# with gr.Blocks() as demo:
|
15 |
# with gr.Row():
|
|
|
9 |
mask = np.where(alpha_channel == 0, 0, 255)
|
10 |
|
11 |
# return img["background"], mask
|
12 |
+
# Save the mask as a PNG file
|
13 |
+
output_path = "mask_output.png"
|
14 |
+
imageio.imwrite(output_path, mask) # Save the mask as a PNG
|
15 |
+
|
16 |
+
return output_path
|
17 |
|
18 |
# with gr.Blocks() as demo:
|
19 |
# with gr.Row():
|