F24EE commited on
Commit
deeaa92
·
verified ·
1 Parent(s): b424851

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
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