ovi054 commited on
Commit
70f48cc
·
verified ·
1 Parent(s): fd0a6a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -8,7 +8,8 @@ def process_image(img):
8
  alpha_channel = img["layers"][0][:, :, 3]
9
  mask = np.where(alpha_channel == 0, 0, 255)
10
 
11
- return img["background"], mask
 
12
 
13
  # with gr.Blocks() as demo:
14
  # with gr.Row():
@@ -21,9 +22,9 @@ def process_image(img):
21
  # Define the Gradio interface
22
  demo = gr.Interface(
23
  fn=process_image,
24
- inputs=gr.ImageMask(sources=["upload"], layers=False, transforms=[], format="png", label="base image", show_label=True),
25
  outputs=[
26
- gr.Image(label="Background Image"),
27
  gr.Image(label="Mask Image"),
28
  ],
29
  )
 
8
  alpha_channel = img["layers"][0][:, :, 3]
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():
 
22
  # Define the Gradio interface
23
  demo = gr.Interface(
24
  fn=process_image,
25
+ inputs=gr.ImageMask(sources=["upload"], layers=False, transforms=[], format="png", label="base image", show_label=True, height = 600),
26
  outputs=[
27
+ # gr.Image(label="Background Image"),
28
  gr.Image(label="Mask Image"),
29
  ],
30
  )