Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
0416e0e
1
Parent(s):
3461b21
Removed masked image exception
Browse files
app.py
CHANGED
@@ -319,13 +319,13 @@ def run_grounded_sam(input_image):
|
|
319 |
|
320 |
except Exception as e:
|
321 |
logger.error(f"Error in run_grounded_sam: {e}")
|
322 |
-
# Return original image on error
|
323 |
-
if isinstance(input_image, dict) and "image" in input_image:
|
324 |
-
|
325 |
-
elif isinstance(input_image, Image.Image):
|
326 |
-
|
327 |
-
else:
|
328 |
-
|
329 |
|
330 |
def split_image_with_alpha(image):
|
331 |
image = image.convert("RGB")
|
|
|
319 |
|
320 |
except Exception as e:
|
321 |
logger.error(f"Error in run_grounded_sam: {e}")
|
322 |
+
# # Return original image on error
|
323 |
+
# if isinstance(input_image, dict) and "image" in input_image:
|
324 |
+
# return [input_image["image"], Image.new('RGBA', input_image["image"].size, color=(0, 0, 0, 0))]
|
325 |
+
# elif isinstance(input_image, Image.Image):
|
326 |
+
# return [input_image, Image.new('RGBA', input_image.size, color=(0, 0, 0, 0))]
|
327 |
+
# else:
|
328 |
+
# return [Image.new('RGB', (400, 300), color='gray'), Image.new('RGBA', (400, 300), color=(0, 0, 0, 0))]
|
329 |
|
330 |
def split_image_with_alpha(image):
|
331 |
image = image.convert("RGB")
|