Spaces:
Running
Running
add sources
Browse files
app.py
CHANGED
|
@@ -28,7 +28,7 @@
|
|
| 28 |
#
|
| 29 |
# This project is one of several repositories exploring image segmentation techniques.
|
| 30 |
# All related projects and interactive demos can be found at:
|
| 31 |
-
# https://huggingface.co/spaces/leonelhs/
|
| 32 |
# Self app: https://huggingface.co/spaces/leonelhs/rembg
|
| 33 |
#
|
| 34 |
# Source code is based on or inspired by several projects.
|
|
@@ -67,6 +67,12 @@ def predict(image, session="u2net"):
|
|
| 67 |
image.putalpha(smoot_mask)
|
| 68 |
return image, smoot_mask
|
| 69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
with gr.Blocks(title="Rembg") as app:
|
| 71 |
gr.Markdown("## Remove Background Tool")
|
| 72 |
with gr.Row():
|
|
@@ -83,5 +89,8 @@ with gr.Blocks(title="Rembg") as app:
|
|
| 83 |
|
| 84 |
btn_predict.click(predict, inputs=[inp, sess], outputs=[out, out_mask])
|
| 85 |
|
|
|
|
|
|
|
|
|
|
| 86 |
app.launch(share=False, debug=True, show_error=True, mcp_server=True, pwa=True)
|
| 87 |
app.queue()
|
|
|
|
| 28 |
#
|
| 29 |
# This project is one of several repositories exploring image segmentation techniques.
|
| 30 |
# All related projects and interactive demos can be found at:
|
| 31 |
+
# https://huggingface.co/spaces/leonelhs/removatorsau
|
| 32 |
# Self app: https://huggingface.co/spaces/leonelhs/rembg
|
| 33 |
#
|
| 34 |
# Source code is based on or inspired by several projects.
|
|
|
|
| 67 |
image.putalpha(smoot_mask)
|
| 68 |
return image, smoot_mask
|
| 69 |
|
| 70 |
+
footer = r"""
|
| 71 |
+
<center>
|
| 72 |
+
Demo based on <a href='https://github.com/danielgatis/rembg'>Rembg</a>
|
| 73 |
+
</center>
|
| 74 |
+
"""
|
| 75 |
+
|
| 76 |
with gr.Blocks(title="Rembg") as app:
|
| 77 |
gr.Markdown("## Remove Background Tool")
|
| 78 |
with gr.Row():
|
|
|
|
| 89 |
|
| 90 |
btn_predict.click(predict, inputs=[inp, sess], outputs=[out, out_mask])
|
| 91 |
|
| 92 |
+
with gr.Row():
|
| 93 |
+
gr.HTML(footer)
|
| 94 |
+
|
| 95 |
app.launch(share=False, debug=True, show_error=True, mcp_server=True, pwa=True)
|
| 96 |
app.queue()
|