Spaces:
Running on Zero
Running on Zero
Upload 2 files
Browse files- app.py +77 -0
- requirements.txt +185 -0
app.py
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import subprocess
|
| 3 |
+
from huggingface_hub import login
|
| 4 |
+
|
| 5 |
+
def clone_and_initialize_repo(repo_url, target_dir):
|
| 6 |
+
"""
|
| 7 |
+
Clone a GitHub repository using a personal access token and initialize submodules.
|
| 8 |
+
"""
|
| 9 |
+
github_token = os.getenv("GITHUB_TOKEN")
|
| 10 |
+
if not github_token:
|
| 11 |
+
raise ValueError("Error: GITHUB_TOKEN is not set in environment variables.")
|
| 12 |
+
|
| 13 |
+
# Construct the authenticated repository URL
|
| 14 |
+
authenticated_repo_url = repo_url.replace(
|
| 15 |
+
"https://", f"https://{github_token}@"
|
| 16 |
+
)
|
| 17 |
+
|
| 18 |
+
try:
|
| 19 |
+
# Clone the repository
|
| 20 |
+
print(f"Cloning repository from {repo_url} into {target_dir}...")
|
| 21 |
+
subprocess.run(
|
| 22 |
+
["git", "clone", "--recurse-submodules", authenticated_repo_url, target_dir],
|
| 23 |
+
check=True
|
| 24 |
+
)
|
| 25 |
+
|
| 26 |
+
# Navigate to the repository directory
|
| 27 |
+
os.chdir(target_dir)
|
| 28 |
+
|
| 29 |
+
# Initialize and update submodules
|
| 30 |
+
print("Initializing and updating submodules...")
|
| 31 |
+
subprocess.run(["git", "submodule", "update", "--init", "--recursive"], check=True)
|
| 32 |
+
|
| 33 |
+
print("Repository cloned and submodules initialized successfully.")
|
| 34 |
+
except subprocess.CalledProcessError as e:
|
| 35 |
+
print(f"Error during repository cloning or submodule initialization: {e}")
|
| 36 |
+
raise
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
def huggingface_login():
|
| 40 |
+
"""
|
| 41 |
+
Log in to Hugging Face using the API token from environment variables.
|
| 42 |
+
"""
|
| 43 |
+
hf_token = os.getenv("HF_TOKEN")
|
| 44 |
+
if not hf_token:
|
| 45 |
+
raise ValueError("Error: HF_TOKEN is not set in environment variables.")
|
| 46 |
+
|
| 47 |
+
try:
|
| 48 |
+
print("Logging in to Hugging Face...")
|
| 49 |
+
login(token=hf_token, add_to_git_credential=False)
|
| 50 |
+
print("Hugging Face login successful.")
|
| 51 |
+
except Exception as e:
|
| 52 |
+
print(f"Error during Hugging Face login: {e}")
|
| 53 |
+
raise
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def main():
|
| 57 |
+
"""
|
| 58 |
+
Main function to perform all operations.
|
| 59 |
+
"""
|
| 60 |
+
# Define the repository URL and target directory
|
| 61 |
+
repo_url = "https://github.com/dadwadw233/BoxDreamer.git"
|
| 62 |
+
target_dir = "./BoxDreamer"
|
| 63 |
+
|
| 64 |
+
try:
|
| 65 |
+
# Clone the repository and initialize submodules
|
| 66 |
+
clone_and_initialize_repo(repo_url, target_dir)
|
| 67 |
+
|
| 68 |
+
# Log in to Hugging Face
|
| 69 |
+
huggingface_login()
|
| 70 |
+
|
| 71 |
+
print("All operations completed successfully.")
|
| 72 |
+
except Exception as e:
|
| 73 |
+
print(f"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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
git+https://github.com/facebookresearch/pytorch3d.git
|
| 2 |
+
https://github.com/MiroPsota/torch_packages_builder/releases/download/SAM_2-1.0%2Bc2ec8e1/SAM_2-1.0%2Bc2ec8e1pt2.5.1cu121-cp310-cp310-linux_x86_64.whl
|
| 3 |
+
|
| 4 |
+
decord
|
| 5 |
+
pyqt5
|
| 6 |
+
gradio
|
| 7 |
+
transformers
|
| 8 |
+
|
| 9 |
+
addict==2.4.0
|
| 10 |
+
aiohappyeyeballs==2.6.1
|
| 11 |
+
aiohttp==3.11.14
|
| 12 |
+
aiosignal==1.3.2
|
| 13 |
+
albucore==0.0.23
|
| 14 |
+
albumentations==2.0.5
|
| 15 |
+
annotated-types==0.7.0
|
| 16 |
+
antlr4-python3-runtime==4.9.3
|
| 17 |
+
asttokens==3.0.0
|
| 18 |
+
attrs==25.3.0
|
| 19 |
+
autocommand==2.2.2
|
| 20 |
+
backports.tarfile==1.2.0
|
| 21 |
+
blinker==1.9.0
|
| 22 |
+
certifi==2025.1.31
|
| 23 |
+
cfgv==3.4.0
|
| 24 |
+
charset-normalizer==3.4.1
|
| 25 |
+
cheroot==10.0.1
|
| 26 |
+
CherryPy==18.10.0
|
| 27 |
+
click==8.1.8
|
| 28 |
+
comm==0.2.2
|
| 29 |
+
ConfigArgParse==1.7
|
| 30 |
+
contourpy==1.3.1
|
| 31 |
+
cycler==0.12.1
|
| 32 |
+
dash==3.0.0
|
| 33 |
+
decorator==5.2.1
|
| 34 |
+
distlib==0.3.9
|
| 35 |
+
docker-pycreds==0.4.0
|
| 36 |
+
einops==0.8.1
|
| 37 |
+
executing==2.2.0
|
| 38 |
+
fastjsonschema==2.21.1
|
| 39 |
+
filelock==3.13.1
|
| 40 |
+
Flask==3.0.3
|
| 41 |
+
fonttools==4.56.0
|
| 42 |
+
frozenlist==1.5.0
|
| 43 |
+
fsspec==2024.6.1
|
| 44 |
+
git-filter-repo==2.38.0
|
| 45 |
+
gitdb==4.0.12
|
| 46 |
+
GitPython==3.1.44
|
| 47 |
+
h5py==3.13.0
|
| 48 |
+
huggingface-hub==0.29.3
|
| 49 |
+
hydra-core==1.3.2
|
| 50 |
+
identify==2.6.9
|
| 51 |
+
idna==3.10
|
| 52 |
+
imageio==2.37.0
|
| 53 |
+
importlib_metadata==8.6.1
|
| 54 |
+
iopath==0.1.10
|
| 55 |
+
ipython_pygments_lexers==1.1.1
|
| 56 |
+
ipywidgets==8.1.5
|
| 57 |
+
itsdangerous==2.2.0
|
| 58 |
+
jaraco.collections==5.1.0
|
| 59 |
+
jaraco.context==6.0.1
|
| 60 |
+
jaraco.functools==4.1.0
|
| 61 |
+
jaraco.text==4.0.0
|
| 62 |
+
jedi==0.19.2
|
| 63 |
+
Jinja2==3.1.4
|
| 64 |
+
joblib==1.4.2
|
| 65 |
+
jsonpatch==1.33
|
| 66 |
+
jsonpointer==3.0.0
|
| 67 |
+
jsonschema==4.23.0
|
| 68 |
+
jsonschema-specifications==2024.10.1
|
| 69 |
+
jupyter_core==5.7.2
|
| 70 |
+
jupyterlab_widgets==3.0.13
|
| 71 |
+
kiwisolver==1.4.8
|
| 72 |
+
kornia==0.8.0
|
| 73 |
+
kornia_rs==0.1.8
|
| 74 |
+
lightning==2.5.0.post0
|
| 75 |
+
lightning-utilities==0.14.1
|
| 76 |
+
lmdb==1.6.2
|
| 77 |
+
loguru==0.7.3
|
| 78 |
+
markdown-it-py==3.0.0
|
| 79 |
+
MarkupSafe==2.1.5
|
| 80 |
+
matplotlib==3.10.1
|
| 81 |
+
matplotlib-inline==0.1.7
|
| 82 |
+
mdurl==0.1.2
|
| 83 |
+
more-itertools==10.6.0
|
| 84 |
+
mpmath==1.3.0
|
| 85 |
+
multidict==6.2.0
|
| 86 |
+
narwhals==1.31.0
|
| 87 |
+
natsort==8.4.0
|
| 88 |
+
nbformat==5.10.4
|
| 89 |
+
nest-asyncio==1.6.0
|
| 90 |
+
networkx==3.3
|
| 91 |
+
nodeenv==1.9.1
|
| 92 |
+
numpy==2.1.2
|
| 93 |
+
nvidia-cublas-cu12==12.1.3.1
|
| 94 |
+
nvidia-cuda-cupti-cu12==12.1.105
|
| 95 |
+
nvidia-cuda-nvrtc-cu12==12.1.105
|
| 96 |
+
nvidia-cuda-runtime-cu12==12.1.105
|
| 97 |
+
nvidia-cudnn-cu12==9.1.0.70
|
| 98 |
+
nvidia-cufft-cu12==11.0.2.54
|
| 99 |
+
nvidia-curand-cu12==10.3.2.106
|
| 100 |
+
nvidia-cusolver-cu12==11.4.5.107
|
| 101 |
+
nvidia-cusparse-cu12==12.1.0.106
|
| 102 |
+
nvidia-nccl-cu12==2.21.5
|
| 103 |
+
nvidia-nvjitlink-cu12==12.1.105
|
| 104 |
+
nvidia-nvtx-cu12==12.1.105
|
| 105 |
+
omegaconf==2.3.0
|
| 106 |
+
open3d==0.19.0
|
| 107 |
+
opencv-python==4.11.0.86
|
| 108 |
+
opencv-python-headless==4.11.0.86
|
| 109 |
+
packaging==24.2
|
| 110 |
+
pandas==2.2.3
|
| 111 |
+
parso==0.8.4
|
| 112 |
+
pexpect==4.9.0
|
| 113 |
+
pillow==11.0.0
|
| 114 |
+
platformdirs==4.3.6
|
| 115 |
+
plotly==6.0.1
|
| 116 |
+
plyfile==1.1
|
| 117 |
+
portalocker==3.1.1
|
| 118 |
+
portend==3.2.0
|
| 119 |
+
pre_commit==4.1.0
|
| 120 |
+
prompt_toolkit==3.0.50
|
| 121 |
+
propcache==0.3.0
|
| 122 |
+
protobuf==5.29.3
|
| 123 |
+
psutil==7.0.0
|
| 124 |
+
ptyprocess==0.7.0
|
| 125 |
+
pure_eval==0.2.3
|
| 126 |
+
pyceres==2.4
|
| 127 |
+
pycolmap==3.11.1
|
| 128 |
+
pydantic==2.10.6
|
| 129 |
+
pydantic_core==2.27.2
|
| 130 |
+
Pygments==2.19.1
|
| 131 |
+
pyparsing==3.2.1
|
| 132 |
+
pyquaternion==0.9.9
|
| 133 |
+
pyte==0.8.2
|
| 134 |
+
python-dateutil==2.9.0.post0
|
| 135 |
+
pytorch-lightning==2.5.0.post0
|
| 136 |
+
pytz==2025.1
|
| 137 |
+
PyYAML==6.0.2
|
| 138 |
+
referencing==0.36.2
|
| 139 |
+
requests==2.32.3
|
| 140 |
+
retrying==1.3.4
|
| 141 |
+
rich==13.9.4
|
| 142 |
+
roma==1.5.2.1
|
| 143 |
+
rpds-py==0.23.1
|
| 144 |
+
safetensors==0.5.3
|
| 145 |
+
scikit-learn==1.6.1
|
| 146 |
+
scipy==1.15.2
|
| 147 |
+
sentry-sdk==2.23.1
|
| 148 |
+
setproctitle==1.3.5
|
| 149 |
+
simsimd==6.2.1
|
| 150 |
+
six==1.17.0
|
| 151 |
+
smmap==5.0.2
|
| 152 |
+
stack-data==0.6.3
|
| 153 |
+
stringcase==1.2.0
|
| 154 |
+
stringzilla==3.12.3
|
| 155 |
+
sympy==1.13.1
|
| 156 |
+
tempora==5.8.0
|
| 157 |
+
tensorboardX==2.6.2.2
|
| 158 |
+
thefuck==3.32
|
| 159 |
+
threadpoolctl==3.6.0
|
| 160 |
+
timm==1.0.15
|
| 161 |
+
torch==2.5.1+cu121
|
| 162 |
+
torchaudio==2.5.1+cu121
|
| 163 |
+
torchmetrics==1.6.3
|
| 164 |
+
torchvision==0.20.1+cu121
|
| 165 |
+
tornado==6.4.2
|
| 166 |
+
tqdm==4.67.1
|
| 167 |
+
traitlets==5.14.3
|
| 168 |
+
transforms3d==0.4.2
|
| 169 |
+
trimesh==4.6.4
|
| 170 |
+
triton==3.1.0
|
| 171 |
+
typing_extensions==4.12.2
|
| 172 |
+
tzdata==2025.1
|
| 173 |
+
urllib3==2.3.0
|
| 174 |
+
virtualenv==20.29.3
|
| 175 |
+
visdom==0.2.4
|
| 176 |
+
vulture==2.14
|
| 177 |
+
wandb==0.19.8
|
| 178 |
+
wcwidth==0.2.13
|
| 179 |
+
websocket-client==1.8.0
|
| 180 |
+
Werkzeug==3.0.6
|
| 181 |
+
widgetsnbextension==4.0.13
|
| 182 |
+
wis3d==1.0.1
|
| 183 |
+
yarl==1.18.3
|
| 184 |
+
zc.lockfile==3.0.post1
|
| 185 |
+
zipp==3.21.0
|