codic commited on
Commit
1c77dfd
·
verified ·
1 Parent(s): 1da217a

fixing the image process

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -51,7 +51,7 @@ def process_image(image_path, depth_map_path=None):
51
  )
52
 
53
  # Remove background using the API + rmbg combination
54
- foreground = remove_background_with_api(image_path)
55
 
56
  # Check if user-provided depth map is available
57
  if depth_map_path:
@@ -115,7 +115,7 @@ def process_image(image_path, depth_map_path=None):
115
  gltf_path = create_3d_obj(np.array(foreground), blended_depth_image, None, image_path, depth=9)
116
  img = Image.fromarray(blended_depth_image)
117
  return [img, gltf_path, gltf_path]
118
-
119
  def create_3d_obj(foreground, depth_image, background, image_path, depth=10):
120
  depth_image_resized = np.array(
121
  Image.fromarray(depth_image).resize(foreground.shape[:2][::-1], Image.LANCZOS)
 
51
  )
52
 
53
  # Remove background using the API + rmbg combination
54
+ foreground = remove_background(image_raw)
55
 
56
  # Check if user-provided depth map is available
57
  if depth_map_path:
 
115
  gltf_path = create_3d_obj(np.array(foreground), blended_depth_image, None, image_path, depth=9)
116
  img = Image.fromarray(blended_depth_image)
117
  return [img, gltf_path, gltf_path]
118
+
119
  def create_3d_obj(foreground, depth_image, background, image_path, depth=10):
120
  depth_image_resized = np.array(
121
  Image.fromarray(depth_image).resize(foreground.shape[:2][::-1], Image.LANCZOS)