codic commited on
Commit
7866d47
·
verified ·
1 Parent(s): df6d9c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -25,13 +25,13 @@ def process_image(image_path, depth_map_path=None):
25
 
26
  # Step 1: Perform background removal
27
  result = client.predict(
28
- image=handle_file(image_path), # Use the input image
29
- api_name="/image"
30
  )
31
-
32
- # Assuming the result contains the foreground mask and processed image
33
- foreground_image_url = result['output'] # Replace with actual response from API
34
- foreground_image = Image.open(foreground_image_url)
35
 
36
  if depth_map_path:
37
  # Load and resize the user-provided depth map to match the RGB image size
 
25
 
26
  # Step 1: Perform background removal
27
  result = client.predict(
28
+ f=handle_file(image_path), # Use the input image
29
+ api_name="/png" # Ensure the correct API endpoint for PNG output
30
  )
31
+
32
+ # Load the foreground image from the returned file path
33
+ foreground_image_path = result # This contains the path to the processed image
34
+ foreground_image = Image.open(foreground_image_path) # Open the image
35
 
36
  if depth_map_path:
37
  # Load and resize the user-provided depth map to match the RGB image size