Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,16 +22,16 @@ def remove_bg(image):
|
|
| 22 |
except Exception as e:
|
| 23 |
raise gr.Error(f"Error processing image: {str(e)}")
|
| 24 |
|
| 25 |
-
#
|
| 26 |
iface = gr.Interface(
|
| 27 |
fn=remove_bg,
|
| 28 |
inputs=gr.Image(type="filepath", label="Input Image"),
|
| 29 |
outputs=gr.Image(label="Output Image", type="pil"),
|
| 30 |
title="Background Remover",
|
| 31 |
description="Upload an image to remove its background",
|
| 32 |
-
|
| 33 |
)
|
| 34 |
|
| 35 |
-
# Launch the app
|
| 36 |
if __name__ == "__main__":
|
| 37 |
-
iface.launch(server_name="0.0.0.0", server_port=7860
|
|
|
|
| 22 |
except Exception as e:
|
| 23 |
raise gr.Error(f"Error processing image: {str(e)}")
|
| 24 |
|
| 25 |
+
# Create interface with correct flagging mode
|
| 26 |
iface = gr.Interface(
|
| 27 |
fn=remove_bg,
|
| 28 |
inputs=gr.Image(type="filepath", label="Input Image"),
|
| 29 |
outputs=gr.Image(label="Output Image", type="pil"),
|
| 30 |
title="Background Remover",
|
| 31 |
description="Upload an image to remove its background",
|
| 32 |
+
flagging_mode="never" # Correct way to disable flagging
|
| 33 |
)
|
| 34 |
|
| 35 |
+
# Launch the app (API is automatically enabled in newer Gradio versions)
|
| 36 |
if __name__ == "__main__":
|
| 37 |
+
iface.launch(server_name="0.0.0.0", server_port=7860)
|