codic commited on
Commit
d907fc7
·
verified ·
1 Parent(s): 6abcef5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -28,7 +28,7 @@ def process_image(image_path, depth_map_path=None):
28
  foreground = remove(image_raw)
29
  foreground = Image.fromarray(np.array(foreground)).convert("RGB")
30
 
31
- # Check if a depth map is provided by the user
32
  if depth_map_path:
33
  if depth_map_path.endswith('.npy'):
34
  depth_image = np.load(depth_map_path).astype(np.float32)
@@ -165,7 +165,7 @@ def create_3d_obj(foreground, depth_image, image_path, depth=12):
165
  o3d.io.write_triangle_mesh(gltf_path, mesh_crop, write_triangle_uvs=True)
166
 
167
  return gltf_path
168
-
169
  # Gradio Interface
170
  title = "Depth Estimation & 3D Reconstruction Demo"
171
  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."
 
28
  foreground = remove(image_raw)
29
  foreground = Image.fromarray(np.array(foreground)).convert("RGB")
30
 
31
+ # Load or generate depth map
32
  if depth_map_path:
33
  if depth_map_path.endswith('.npy'):
34
  depth_image = np.load(depth_map_path).astype(np.float32)
 
165
  o3d.io.write_triangle_mesh(gltf_path, mesh_crop, write_triangle_uvs=True)
166
 
167
  return gltf_path
168
+
169
  # Gradio Interface
170
  title = "Depth Estimation & 3D Reconstruction Demo"
171
  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."