OriLib commited on
Commit
68112f8
1 Parent(s): 89f2054

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -53,10 +53,10 @@ def process(image):
53
  # paste the mask on the original image
54
  new_im = Image.new("RGBA", pil_im.size, (0,0,0,0))
55
  new_im.paste(orig_image, mask=pil_im)
56
- new_orig_image = orig_image.convert('RGBA')
57
 
58
- # return new_im
59
- return [new_orig_image, new_im]
60
 
61
 
62
  # block = gr.Blocks().queue()
@@ -94,9 +94,9 @@ gr.HTML('''
94
  title = "Background Removal"
95
  description = "Remove background from any image"
96
  examples = [['./input.jpg'],]
97
- output = ImageSlider(position=0.5,label='Image without background', type="pil", show_download_button=True)
98
- demo = gr.Interface(fn=process,inputs="image", outputs=output, examples=examples, title=title, description=description)
99
- # demo = gr.Interface(fn=process,inputs="image", outputs="image", examples=examples, title=title, description=description)
100
 
101
  if __name__ == "__main__":
102
  demo.launch(share=False)
 
53
  # paste the mask on the original image
54
  new_im = Image.new("RGBA", pil_im.size, (0,0,0,0))
55
  new_im.paste(orig_image, mask=pil_im)
56
+ # new_orig_image = orig_image.convert('RGBA')
57
 
58
+ return new_im
59
+ # return [new_orig_image, new_im]
60
 
61
 
62
  # block = gr.Blocks().queue()
 
94
  title = "Background Removal"
95
  description = "Remove background from any image"
96
  examples = [['./input.jpg'],]
97
+ # output = ImageSlider(position=0.5,label='Image without background', type="pil", show_download_button=True)
98
+ # demo = gr.Interface(fn=process,inputs="image", outputs=output, examples=examples, title=title, description=description)
99
+ demo = gr.Interface(fn=process,inputs="image", outputs="image", examples=examples, title=title, description=description)
100
 
101
  if __name__ == "__main__":
102
  demo.launch(share=False)