Update app.py
Browse files
app.py
CHANGED
|
@@ -126,6 +126,7 @@ def process_image(image_path, depth_map_path=None):
|
|
| 126 |
except Exception as e:
|
| 127 |
print(f"Error with default depth: {str(e)}. Retrying with a shallower depth.")
|
| 128 |
gltf_path = create_3d_obj(np.array(foreground).astype(np.float32), blended_depth_image, background_inpainted, image_path, depth=9)
|
|
|
|
| 129 |
img = Image.fromarray(img_as_ubyte(blended_depth_image))
|
| 130 |
return [img, gr.Model3D(), gltf_path]
|
| 131 |
|
|
|
|
| 126 |
except Exception as e:
|
| 127 |
print(f"Error with default depth: {str(e)}. Retrying with a shallower depth.")
|
| 128 |
gltf_path = create_3d_obj(np.array(foreground).astype(np.float32), blended_depth_image, background_inpainted, image_path, depth=9)
|
| 129 |
+
blended_depth_image = np.clip(blended_depth_image, 0, 1)
|
| 130 |
img = Image.fromarray(img_as_ubyte(blended_depth_image))
|
| 131 |
return [img, gr.Model3D(), gltf_path]
|
| 132 |
|