codic commited on
Commit
5429565
·
verified ·
1 Parent(s): 22f4ff7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -88,11 +88,11 @@ def process_image(image_path, depth_map_path=None):
88
  return [img, gltf_path, gltf_path]
89
  except Exception as e:
90
  print(f"Error with depth=8: {str(e)}. Retrying with depth=14.")
91
- gltf_path = create_3d_obj(np.array(foreground), blended_depth_image, None, image_path, depth=14)
92
  img = Image.fromarray(blended_depth_image)
93
  return [img, gltf_path, gltf_path]
94
 
95
- def create_3d_obj(foreground, depth_image, background, image_path, depth=14):
96
  # Ensure depth is at least 2 for Open3D compatibility
97
  depth = max(depth, 2)
98
 
 
88
  return [img, gltf_path, gltf_path]
89
  except Exception as e:
90
  print(f"Error with depth=8: {str(e)}. Retrying with depth=14.")
91
+ gltf_path = create_3d_obj(np.array(foreground), blended_depth_image, None, image_path, depth=12)
92
  img = Image.fromarray(blended_depth_image)
93
  return [img, gltf_path, gltf_path]
94
 
95
+ def create_3d_obj(foreground, depth_image, background, image_path, depth=12):
96
  # Ensure depth is at least 2 for Open3D compatibility
97
  depth = max(depth, 2)
98