Update app.py
Browse files
app.py
CHANGED
|
@@ -129,8 +129,8 @@ def create_3d_obj(foreground, depth_image, background, image_path, depth=10):
|
|
| 129 |
)
|
| 130 |
|
| 131 |
# Get dimensions of the rgbd_image
|
| 132 |
-
rgbd_width = rgbd_image.color.
|
| 133 |
-
rgbd_height = rgbd_image.color.
|
| 134 |
|
| 135 |
# Check if the depth and foreground sizes are compatible
|
| 136 |
if rgbd_width != foreground.shape[1] or rgbd_height != foreground.shape[0]:
|
|
@@ -183,7 +183,6 @@ def create_3d_obj(foreground, depth_image, background, image_path, depth=10):
|
|
| 183 |
|
| 184 |
return gltf_path
|
| 185 |
|
| 186 |
-
|
| 187 |
# Gradio Interface
|
| 188 |
title = "Depth Estimation & 3D Reconstruction Demo"
|
| 189 |
description = "Upload an image and optionally a depth map (in .npy or image format) to generate a 3D model. If no depth map is provided, the DPT model will generate it."
|
|
|
|
| 129 |
)
|
| 130 |
|
| 131 |
# Get dimensions of the rgbd_image
|
| 132 |
+
rgbd_width = rgbd_image.color.width
|
| 133 |
+
rgbd_height = rgbd_image.color.height
|
| 134 |
|
| 135 |
# Check if the depth and foreground sizes are compatible
|
| 136 |
if rgbd_width != foreground.shape[1] or rgbd_height != foreground.shape[0]:
|
|
|
|
| 183 |
|
| 184 |
return gltf_path
|
| 185 |
|
|
|
|
| 186 |
# Gradio Interface
|
| 187 |
title = "Depth Estimation & 3D Reconstruction Demo"
|
| 188 |
description = "Upload an image and optionally a depth map (in .npy or image format) to generate a 3D model. If no depth map is provided, the DPT model will generate it."
|