Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,16 +3,15 @@ from rembg import remove
|
|
| 3 |
from PIL import Image
|
| 4 |
|
| 5 |
def remove_bg(image):
|
| 6 |
-
|
| 7 |
-
return output_image
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
)
|
|
|
|
| 15 |
|
| 16 |
-
# Launch the app
|
| 17 |
if __name__ == "__main__":
|
| 18 |
-
demo.launch(
|
|
|
|
| 3 |
from PIL import Image
|
| 4 |
|
| 5 |
def remove_bg(image):
|
| 6 |
+
return remove(image)
|
|
|
|
| 7 |
|
| 8 |
+
with gr.Blocks() as demo:
|
| 9 |
+
gr.Markdown("## U²Net Background Remover API")
|
| 10 |
+
with gr.Row():
|
| 11 |
+
inp = gr.Image(type="pil")
|
| 12 |
+
out = gr.Image()
|
| 13 |
+
submit = gr.Button("Remove Background")
|
| 14 |
+
submit.click(remove_bg, inputs=inp, outputs=out)
|
| 15 |
|
|
|
|
| 16 |
if __name__ == "__main__":
|
| 17 |
+
demo.launch()
|