fffiloni commited on
Commit
166291e
·
verified ·
1 Parent(s): a7c89f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -13,13 +13,22 @@ import requests
13
  # Ensure the required package is installed
14
  def install_dependencies():
15
  try:
16
- subprocess.check_call([sys.executable, "-m", "pip", "install", "pytorch3d"])
 
 
 
 
 
 
 
 
 
17
  except subprocess.CalledProcessError as e:
18
  print(f"Error installing dependencies: {e}")
19
  sys.exit(1) # Exit the script if installation fails
20
 
21
  # Install dependencies at the start
22
- #install_dependencies()
23
 
24
  def remove_background(input_url):
25
  # Create a temporary folder for downloaded and processed images
 
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