Spaces:
Running on Zero
Running on Zero
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -336,9 +336,7 @@ def remove_background(input: Image.Image) -> Image.Image:
|
|
| 336 |
output = Image.open(output)
|
| 337 |
return output
|
| 338 |
except Exception as e:
|
| 339 |
-
|
| 340 |
-
# Return original image with a full-white alpha channel
|
| 341 |
-
return input.convert('RGBA')
|
| 342 |
|
| 343 |
|
| 344 |
def preprocess_image(input: Image.Image) -> Image.Image:
|
|
|
|
| 336 |
output = Image.open(output)
|
| 337 |
return output
|
| 338 |
except Exception as e:
|
| 339 |
+
raise gr.Error(f"Background removal failed: {e}. Please upload images with transparent backgrounds (RGBA), or try again later.")
|
|
|
|
|
|
|
| 340 |
|
| 341 |
|
| 342 |
def preprocess_image(input: Image.Image) -> Image.Image:
|