Spaces:
Running
on
L40S
Running
on
L40S
Update gradio_app.py
Browse files- gradio_app.py +5 -3
gradio_app.py
CHANGED
@@ -190,11 +190,13 @@ def generate_and_process_3d(prompt: str, seed: int = 42, width: int = 1024, heig
|
|
190 |
rgb_image = generated_image.convert('RGB')
|
191 |
|
192 |
print("[debug] removing the background by calling bg_remover.process(rgb_image)")
|
193 |
-
#
|
194 |
no_bg_image = bg_remover.process(rgb_image)
|
|
|
195 |
|
196 |
-
# Convert
|
197 |
-
rgba_image =
|
|
|
198 |
|
199 |
print("[debug] auto-cropping the rgba_image using spar3d_utils.foreground_crop(...)")
|
200 |
processed_image = spar3d_utils.foreground_crop(
|
|
|
190 |
rgb_image = generated_image.convert('RGB')
|
191 |
|
192 |
print("[debug] removing the background by calling bg_remover.process(rgb_image)")
|
193 |
+
# bg_remover returns a PIL Image already, no need to convert
|
194 |
no_bg_image = bg_remover.process(rgb_image)
|
195 |
+
print(f"[debug] no_bg_image type: {type(no_bg_image)}, mode: {no_bg_image.mode}")
|
196 |
|
197 |
+
# Convert to RGBA if not already
|
198 |
+
rgba_image = no_bg_image.convert('RGBA')
|
199 |
+
print(f"[debug] rgba_image mode: {rgba_image.mode}")
|
200 |
|
201 |
print("[debug] auto-cropping the rgba_image using spar3d_utils.foreground_crop(...)")
|
202 |
processed_image = spar3d_utils.foreground_crop(
|