codic commited on
Commit
0e6743b
·
verified ·
1 Parent(s): 6196ced

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -6,7 +6,7 @@ from PIL import Image
6
  import open3d as o3d
7
  from pathlib import Path
8
  import os
9
- from gradio_client import Client, handle_file
10
 
11
  # Initialize feature extractor and model for depth estimation
12
  feature_extractor = DPTFeatureExtractor.from_pretrained("Intel/dpt-large")
@@ -24,10 +24,11 @@ def process_image(image_path, depth_map_path=None):
24
  )
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
 
6
  import open3d as o3d
7
  from pathlib import Path
8
  import os
9
+ from gradio_client import Client
10
 
11
  # Initialize feature extractor and model for depth estimation
12
  feature_extractor = DPTFeatureExtractor.from_pretrained("Intel/dpt-large")
 
24
  )
25
 
26
  # Step 1: Perform background removal
27
+ result = client.predict(
28
+ f=image_path, # Directly use the image path
29
+ api_name="/png"
30
+ )
31
+
32
 
33
  # Load the foreground image from the returned file path
34
  foreground_image_path = result # This contains the path to the processed image