Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,7 +18,7 @@ def remove_background(image):
|
|
| 18 |
|
| 19 |
return output_path, "Background removed successfully!", output_path
|
| 20 |
|
| 21 |
-
# Example images (replace with actual
|
| 22 |
example_images = [
|
| 23 |
"examples/person1.jpg",
|
| 24 |
"examples/product1.jpg",
|
|
@@ -34,7 +34,7 @@ with gr.Blocks(title="Background Remover") as demo:
|
|
| 34 |
|
| 35 |
with gr.Row():
|
| 36 |
with gr.Column():
|
| 37 |
-
image_input = gr.Image(type="pil", label="Input Image"
|
| 38 |
submit_btn = gr.Button("Submit")
|
| 39 |
clear_btn = gr.Button("Clear")
|
| 40 |
with gr.Column():
|
|
@@ -51,7 +51,7 @@ with gr.Blocks(title="Background Remover") as demo:
|
|
| 51 |
label="Click to try an example",
|
| 52 |
)
|
| 53 |
|
| 54 |
-
#
|
| 55 |
submit_btn.click(fn=remove_background, inputs=image_input, outputs=[output_image, output_text, download_output])
|
| 56 |
clear_btn.click(fn=lambda: (None, "", None), outputs=[image_input, output_text, download_output])
|
| 57 |
|
|
|
|
| 18 |
|
| 19 |
return output_path, "Background removed successfully!", output_path
|
| 20 |
|
| 21 |
+
# Example images (replace with your actual image paths in the 'examples' folder)
|
| 22 |
example_images = [
|
| 23 |
"examples/person1.jpg",
|
| 24 |
"examples/product1.jpg",
|
|
|
|
| 34 |
|
| 35 |
with gr.Row():
|
| 36 |
with gr.Column():
|
| 37 |
+
image_input = gr.Image(type="pil", label="Input Image") # FIXED: removed tool="editor"
|
| 38 |
submit_btn = gr.Button("Submit")
|
| 39 |
clear_btn = gr.Button("Clear")
|
| 40 |
with gr.Column():
|
|
|
|
| 51 |
label="Click to try an example",
|
| 52 |
)
|
| 53 |
|
| 54 |
+
# Logic binding
|
| 55 |
submit_btn.click(fn=remove_background, inputs=image_input, outputs=[output_image, output_text, download_output])
|
| 56 |
clear_btn.click(fn=lambda: (None, "", None), outputs=[image_input, output_text, download_output])
|
| 57 |
|