Spaces:
Running
on
L40S
Running
on
L40S
Update app.py
Browse files
app.py
CHANGED
@@ -33,6 +33,7 @@ def remove_background(input_url):
|
|
33 |
shutil.rmtree(temp_dir)
|
34 |
return f"Error downloading or saving the image: {str(e)}"
|
35 |
|
|
|
36 |
# Run background removal
|
37 |
try:
|
38 |
removed_bg_path = os.path.join(temp_dir, 'output_image_rmbg.png')
|
@@ -44,7 +45,9 @@ def remove_background(input_url):
|
|
44 |
return f"Error removing background: {str(e)}"
|
45 |
|
46 |
return removed_bg_path, temp_dir
|
47 |
-
|
|
|
|
|
48 |
def run_inference(temp_dir):
|
49 |
# Define the inference configuration
|
50 |
inference_config = "configs/inference-768-6view.yaml"
|
@@ -98,7 +101,7 @@ def process_image(input_url):
|
|
98 |
for img_path in output_images:
|
99 |
results.append((img_path, img_path))
|
100 |
|
101 |
-
shutil.rmtree(temp_dir) # Cleanup temporary folder
|
102 |
return results
|
103 |
|
104 |
def gradio_interface():
|
|
|
33 |
shutil.rmtree(temp_dir)
|
34 |
return f"Error downloading or saving the image: {str(e)}"
|
35 |
|
36 |
+
"""
|
37 |
# Run background removal
|
38 |
try:
|
39 |
removed_bg_path = os.path.join(temp_dir, 'output_image_rmbg.png')
|
|
|
45 |
return f"Error removing background: {str(e)}"
|
46 |
|
47 |
return removed_bg_path, temp_dir
|
48 |
+
"""
|
49 |
+
return image_path, temp_dir
|
50 |
+
|
51 |
def run_inference(temp_dir):
|
52 |
# Define the inference configuration
|
53 |
inference_config = "configs/inference-768-6view.yaml"
|
|
|
101 |
for img_path in output_images:
|
102 |
results.append((img_path, img_path))
|
103 |
|
104 |
+
#shutil.rmtree(temp_dir) # Cleanup temporary folder
|
105 |
return results
|
106 |
|
107 |
def gradio_interface():
|