Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,8 @@ import io
|
|
6 |
# Function to remove background from image
|
7 |
def remove_background(image_bytes):
|
8 |
input_image = Image.open(io.BytesIO(image_bytes))
|
|
|
|
|
9 |
output_image = remove(input_image)
|
10 |
return output_image
|
11 |
|
|
|
6 |
# Function to remove background from image
|
7 |
def remove_background(image_bytes):
|
8 |
input_image = Image.open(io.BytesIO(image_bytes))
|
9 |
+
# Rembg expects the image to be in the correct mode, typically RGBA or RGB
|
10 |
+
input_image = input_image.convert("RGBA")
|
11 |
output_image = remove(input_image)
|
12 |
return output_image
|
13 |
|