ovi054 commited on
Commit
de28594
·
verified ·
1 Parent(s): 03b1ac5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
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
- return mask
 
 
 
 
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():