Spaces:
Running
on
Zero
Running
on
Zero
Fix AttributeError in _gen_shape function when MV_MODE is False
Browse files- Fixed issue where image parameter was passed as dictionary instead of PIL Image object
- Modified process_generation_job to extract single PIL Image from dictionary
- Uses front image or first available image when MV_MODE is False
- Resolves 'dict' object has no attribute 'convert' error in API endpoints
- gradio_app.py +7 -1
gradio_app.py
CHANGED
@@ -147,9 +147,15 @@ def process_generation_job(job_id: str, images: Dict[str, str], options: Dict[st
|
|
147 |
update_job_status(job_id, JobStatus.PROCESSING, progress=20)
|
148 |
|
149 |
# Generate 3D mesh
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
mesh, main_image, save_folder, stats, seed = _gen_shape(
|
151 |
caption=None,
|
152 |
-
image=
|
153 |
mv_image_front=pil_images.get('front'),
|
154 |
mv_image_back=pil_images.get('back'),
|
155 |
mv_image_left=pil_images.get('left'),
|
|
|
147 |
update_job_status(job_id, JobStatus.PROCESSING, progress=20)
|
148 |
|
149 |
# Generate 3D mesh
|
150 |
+
# For non-MV mode, use the front image as the main image, or the first available image
|
151 |
+
main_image = pil_images.get('front')
|
152 |
+
if main_image is None and pil_images:
|
153 |
+
# If no front image, use the first available image
|
154 |
+
main_image = next(iter(pil_images.values()))
|
155 |
+
|
156 |
mesh, main_image, save_folder, stats, seed = _gen_shape(
|
157 |
caption=None,
|
158 |
+
image=main_image,
|
159 |
mv_image_front=pil_images.get('front'),
|
160 |
mv_image_back=pil_images.get('back'),
|
161 |
mv_image_left=pil_images.get('left'),
|