Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -75,4 +75,24 @@ gr.HTML('''<p style="margin-bottom: 10px; font-size: 94%">
|
|
| 75 |
|
| 76 |
title = "Background Removal"
|
| 77 |
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>
|
| 78 |
-
For testing, 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>. To purchase a commercial
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
title = "Background Removal"
|
| 77 |
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>
|
| 78 |
+
For testing, 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>. To purchase a commercial license, simply click <a href='https://go.bria.ai/3ZCBTLH' target='_blank'><b>Here</b></a>. <br>"""
|
| 79 |
+
|
| 80 |
+
examples = [['./input.jpg'],]
|
| 81 |
+
|
| 82 |
+
# Modify the interface to use live updates and file download
|
| 83 |
+
demo = gr.Interface(
|
| 84 |
+
fn=process, # The function to process the image
|
| 85 |
+
inputs=gr.Image(type="numpy"), # Input type (image)
|
| 86 |
+
outputs=[gr.Image(type="pil", label="Original Image"),
|
| 87 |
+
gr.Image(type="pil", label="Processed Image"),
|
| 88 |
+
gr.File(label="Download Processed Image")], # Output as images and a download button
|
| 89 |
+
examples=examples, # Example images for users to try
|
| 90 |
+
title=title, # Title of the app
|
| 91 |
+
description=description, # Description of the app
|
| 92 |
+
live=True, # Automatically processes when an image is uploaded
|
| 93 |
+
layout="horizontal", # Display output images side by side
|
| 94 |
+
)
|
| 95 |
+
|
| 96 |
+
if __name__ == "__main__":
|
| 97 |
+
demo.launch(share=False)
|
| 98 |
+
|