Spaces:
Build error
Build error
update app py
Browse files
app.py
CHANGED
|
@@ -49,10 +49,8 @@ def process(image):
|
|
| 49 |
# paste the mask on the original image
|
| 50 |
new_im = Image.new("RGBA", pil_im.size, (0,0,0,0))
|
| 51 |
new_im.paste(orig_image, mask=pil_im)
|
| 52 |
-
# new_orig_image = orig_image.convert('RGBA')
|
| 53 |
|
| 54 |
return new_im
|
| 55 |
-
# return [new_orig_image, new_im]
|
| 56 |
|
| 57 |
|
| 58 |
# block = gr.Blocks().queue()
|
|
@@ -87,14 +85,10 @@ gr.HTML('''
|
|
| 87 |
<a href="https://huggingface.co/briaai/RMBG-1.4" target="_blank">BRIA RMBG-1.4 image matting model</a> as backbone.
|
| 88 |
</p>
|
| 89 |
''')
|
| 90 |
-
title = "Background Removal"
|
| 91 |
-
description = r"""Background removal model developed by <a href='https://BRIA.AI' target='_blank'><b>BRIA.AI</b></a>, trained on a carefully selected dataset and is available as an open-source model for non-commercial use.<br>
|
| 92 |
-
For test upload your image and wait. Read more at model card <a href='https://huggingface.co/briaai/RMBG-1.4' target='_blank'><b>briaai/RMBG-1.4</b></a>.<br>
|
| 93 |
-
"""
|
| 94 |
examples = [['./input.jpg'],]
|
| 95 |
# output = ImageSlider(position=0.5,label='Image without background', type="pil", show_download_button=True)
|
| 96 |
# demo = gr.Interface(fn=process,inputs="image", outputs=output, examples=examples, title=title, description=description)
|
| 97 |
-
demo = gr.Interface(fn=process,inputs="image", outputs="image", examples=examples
|
| 98 |
|
| 99 |
if __name__ == "__main__":
|
| 100 |
-
demo.launch(share=False)
|
|
|
|
| 49 |
# paste the mask on the original image
|
| 50 |
new_im = Image.new("RGBA", pil_im.size, (0,0,0,0))
|
| 51 |
new_im.paste(orig_image, mask=pil_im)
|
|
|
|
| 52 |
|
| 53 |
return new_im
|
|
|
|
| 54 |
|
| 55 |
|
| 56 |
# block = gr.Blocks().queue()
|
|
|
|
| 85 |
<a href="https://huggingface.co/briaai/RMBG-1.4" target="_blank">BRIA RMBG-1.4 image matting model</a> as backbone.
|
| 86 |
</p>
|
| 87 |
''')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
examples = [['./input.jpg'],]
|
| 89 |
# output = ImageSlider(position=0.5,label='Image without background', type="pil", show_download_button=True)
|
| 90 |
# demo = gr.Interface(fn=process,inputs="image", outputs=output, examples=examples, title=title, description=description)
|
| 91 |
+
demo = gr.Interface(fn=process,inputs="image", outputs="image", examples=examples)
|
| 92 |
|
| 93 |
if __name__ == "__main__":
|
| 94 |
+
demo.launch(share=False)
|