Spaces:
Running
on
L40S
Running
on
L40S
Update app.py
Browse files
app.py
CHANGED
@@ -44,7 +44,8 @@ def remove_background(input_url):
|
|
44 |
image_path = os.path.join(temp_dir, 'input_image.png')
|
45 |
try:
|
46 |
image = Image.open(input_url)
|
47 |
-
image.
|
|
|
48 |
except Exception as e:
|
49 |
shutil.rmtree(temp_dir)
|
50 |
return f"Error downloading or saving the image: {str(e)}"
|
|
|
44 |
image_path = os.path.join(temp_dir, 'input_image.png')
|
45 |
try:
|
46 |
image = Image.open(input_url)
|
47 |
+
flipped_image = image.transpose(Image.FLIP_LEFT_RIGHT) # Mirror-flip the image
|
48 |
+
flipped_image.save(image_path)
|
49 |
except Exception as e:
|
50 |
shutil.rmtree(temp_dir)
|
51 |
return f"Error downloading or saving the image: {str(e)}"
|