Update app.py
Browse files
app.py
CHANGED
@@ -10,26 +10,6 @@ import subprocess
|
|
10 |
from glob import glob
|
11 |
import requests
|
12 |
|
13 |
-
# Ensure the required package is installed
|
14 |
-
def install_dependencies():
|
15 |
-
try:
|
16 |
-
# Clone the repository
|
17 |
-
repo_url = "https://github.com/facebookresearch/pytorch3d.git"
|
18 |
-
repo_dir = "pytorch3d"
|
19 |
-
|
20 |
-
if not os.path.exists(repo_dir): # Only clone if the directory doesn't already exist
|
21 |
-
subprocess.check_call(["git", "clone", repo_url])
|
22 |
-
|
23 |
-
# Install in editable mode
|
24 |
-
subprocess.check_call([sys.executable, "-m", "pip", "install", "-e", repo_dir])
|
25 |
-
|
26 |
-
except subprocess.CalledProcessError as e:
|
27 |
-
print(f"Error installing dependencies: {e}")
|
28 |
-
sys.exit(1) # Exit the script if installation fails
|
29 |
-
|
30 |
-
# Install dependencies at the start
|
31 |
-
install_dependencies()
|
32 |
-
|
33 |
def remove_background(input_url):
|
34 |
# Create a temporary folder for downloaded and processed images
|
35 |
temp_dir = tempfile.mkdtemp()
|
|
|
10 |
from glob import glob
|
11 |
import requests
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
def remove_background(input_url):
|
14 |
# Create a temporary folder for downloaded and processed images
|
15 |
temp_dir = tempfile.mkdtemp()
|