Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,6 +46,8 @@ def install_dependencies():
|
|
| 46 |
|
| 47 |
# 2. User Defined Package List
|
| 48 |
packages = [
|
|
|
|
|
|
|
| 49 |
# Core ML & Hydra
|
| 50 |
"hydra-core", "hydra-submitit-launcher", "omegaconf", "numpy", "einops",
|
| 51 |
"einops-exts", "timm", "diffusers", "transformers", "accelerate", "safetensors",
|
|
@@ -55,7 +57,7 @@ def install_dependencies():
|
|
| 55 |
# Visualization & UI
|
| 56 |
"seaborn", "gradio", "tensorboard", "wandb", "polyscope",
|
| 57 |
# 3D & Graphics
|
| 58 |
-
"
|
| 59 |
"pymeshfix", "xatlas", "panda3d-gltf", "fvcore", "roma", "smplx",
|
| 60 |
"OpenEXR", "imath",
|
| 61 |
# Video & Audio
|
|
@@ -84,13 +86,20 @@ def install_dependencies():
|
|
| 84 |
# Jupyter & Misc
|
| 85 |
"jupyter", "dataclasses", "crcmod", "conda-pack", "pip-system-certs",
|
| 86 |
"python-pycg", "pymongo", "sagemaker", "mosaicml-streaming", "bpy",
|
| 87 |
-
# Git installs
|
| 88 |
"git+https://github.com/nerfstudio-project/gsplat.git",
|
| 89 |
-
"git+https://github.com/facebookresearch/pytorch3d",
|
| 90 |
"git+https://github.com/microsoft/MoGe.git",
|
| 91 |
"utils3d",
|
| 92 |
]
|
| 93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
for pkg in packages:
|
| 95 |
print(f"----------------------------------------")
|
| 96 |
print(f"Installing: {pkg}")
|
|
@@ -101,6 +110,17 @@ def install_dependencies():
|
|
| 101 |
except subprocess.CalledProcessError as e:
|
| 102 |
print(f"❌ Failed to install {pkg}. Continuing to next package...")
|
| 103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
# 3. Clone & Install Main Repo (SAM 3D Objects)
|
| 105 |
if not os.path.exists(REPO_DIR):
|
| 106 |
print(f"Cloning repository to {REPO_DIR}...")
|
|
|
|
| 46 |
|
| 47 |
# 2. User Defined Package List
|
| 48 |
packages = [
|
| 49 |
+
# MUST INSTALL FIRST: PyTorch (required for building flash_attn, pytorch3d, etc.)
|
| 50 |
+
"torch", "torchvision",
|
| 51 |
# Core ML & Hydra
|
| 52 |
"hydra-core", "hydra-submitit-launcher", "omegaconf", "numpy", "einops",
|
| 53 |
"einops-exts", "timm", "diffusers", "transformers", "accelerate", "safetensors",
|
|
|
|
| 57 |
# Visualization & UI
|
| 58 |
"seaborn", "gradio", "tensorboard", "wandb", "polyscope",
|
| 59 |
# 3D & Graphics
|
| 60 |
+
"open3d", "pyrender", "point-cloud-utils",
|
| 61 |
"pymeshfix", "xatlas", "panda3d-gltf", "fvcore", "roma", "smplx",
|
| 62 |
"OpenEXR", "imath",
|
| 63 |
# Video & Audio
|
|
|
|
| 86 |
# Jupyter & Misc
|
| 87 |
"jupyter", "dataclasses", "crcmod", "conda-pack", "pip-system-certs",
|
| 88 |
"python-pycg", "pymongo", "sagemaker", "mosaicml-streaming", "bpy",
|
| 89 |
+
# Git installs (pytorch3d requires torch, so it's near the end)
|
| 90 |
"git+https://github.com/nerfstudio-project/gsplat.git",
|
| 91 |
+
"git+https://github.com/facebookresearch/pytorch3d.git",
|
| 92 |
"git+https://github.com/microsoft/MoGe.git",
|
| 93 |
"utils3d",
|
| 94 |
]
|
| 95 |
|
| 96 |
+
# Packages that require special handling - install with --no-build-isolation
|
| 97 |
+
# so they can find torch during build
|
| 98 |
+
special_packages = [
|
| 99 |
+
"flash_attn",
|
| 100 |
+
"kaolin",
|
| 101 |
+
]
|
| 102 |
+
|
| 103 |
for pkg in packages:
|
| 104 |
print(f"----------------------------------------")
|
| 105 |
print(f"Installing: {pkg}")
|
|
|
|
| 110 |
except subprocess.CalledProcessError as e:
|
| 111 |
print(f"❌ Failed to install {pkg}. Continuing to next package...")
|
| 112 |
|
| 113 |
+
# Install packages that need --no-build-isolation (require torch at build time)
|
| 114 |
+
for pkg in special_packages:
|
| 115 |
+
print(f"----------------------------------------")
|
| 116 |
+
print(f"Installing (no-build-isolation): {pkg}")
|
| 117 |
+
print(f"----------------------------------------")
|
| 118 |
+
try:
|
| 119 |
+
cmd = [sys.executable, "-m", "pip", "install", "--no-build-isolation", pkg]
|
| 120 |
+
subprocess.run(cmd, env=env, check=True)
|
| 121 |
+
except subprocess.CalledProcessError as e:
|
| 122 |
+
print(f"❌ Failed to install {pkg}. Continuing to next package...")
|
| 123 |
+
|
| 124 |
# 3. Clone & Install Main Repo (SAM 3D Objects)
|
| 125 |
if not os.path.exists(REPO_DIR):
|
| 126 |
print(f"Cloning repository to {REPO_DIR}...")
|