Spaces:
Running
Running
pre install
Browse files- Dockerfile +1 -0
- install.py +21 -0
- launch.py +2 -2
Dockerfile
CHANGED
@@ -25,4 +25,5 @@ WORKDIR $HOME/app
|
|
25 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
26 |
COPY --chown=user . $HOME/app
|
27 |
|
|
|
28 |
CMD ["python3", "launch.py"]
|
|
|
25 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
26 |
COPY --chown=user . $HOME/app
|
27 |
|
28 |
+
CMD ["python3", "install.py"]
|
29 |
CMD ["python3", "launch.py"]
|
install.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import sys
|
3 |
+
import json
|
4 |
+
import uuid
|
5 |
+
import numpy as np
|
6 |
+
import gradio as gr
|
7 |
+
import trimesh
|
8 |
+
import zipfile
|
9 |
+
import subprocess
|
10 |
+
from datetime import datetime
|
11 |
+
from functools import partial
|
12 |
+
from PIL import Image, ImageChops
|
13 |
+
from huggingface_hub import snapshot_download
|
14 |
+
|
15 |
+
|
16 |
+
is_local_run = os.path.exists("../SpaRP_API")
|
17 |
+
code_dir = snapshot_download("sudo-ai/SpaRP_API", token=os.environ['HF_TOKEN']) if not is_local_run else "../SpaRP_API"
|
18 |
+
|
19 |
+
os.system(f"pip install {code_dir}/gradio_model3dcolor-0.0.1-py3-none-any.whl")
|
20 |
+
os.system(f"pip install {code_dir}/gradio_model3dnormal-0.0.1-py3-none-any.whl")
|
21 |
+
|
launch.py
CHANGED
@@ -16,8 +16,8 @@ from huggingface_hub import snapshot_download
|
|
16 |
is_local_run = os.path.exists("../SpaRP_API")
|
17 |
code_dir = snapshot_download("sudo-ai/SpaRP_API", token=os.environ['HF_TOKEN']) if not is_local_run else "../SpaRP_API"
|
18 |
|
19 |
-
os.system(f"pip install {code_dir}/gradio_model3dcolor-0.0.1-py3-none-any.whl")
|
20 |
-
os.system(f"pip install {code_dir}/gradio_model3dnormal-0.0.1-py3-none-any.whl")
|
21 |
|
22 |
from gradio_model3dcolor import Model3DColor
|
23 |
from gradio_model3dnormal import Model3DNormal
|
|
|
16 |
is_local_run = os.path.exists("../SpaRP_API")
|
17 |
code_dir = snapshot_download("sudo-ai/SpaRP_API", token=os.environ['HF_TOKEN']) if not is_local_run else "../SpaRP_API"
|
18 |
|
19 |
+
# os.system(f"pip install {code_dir}/gradio_model3dcolor-0.0.1-py3-none-any.whl")
|
20 |
+
# os.system(f"pip install {code_dir}/gradio_model3dnormal-0.0.1-py3-none-any.whl")
|
21 |
|
22 |
from gradio_model3dcolor import Model3DColor
|
23 |
from gradio_model3dnormal import Model3DNormal
|