Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +25 -14
Dockerfile
CHANGED
@@ -50,41 +50,52 @@ RUN groupadd -g ${GID} ${GROUP_NAME} \
|
|
50 |
&& useradd -ms /bin/sh -u ${UID} -g ${GID} ${USER_NAME}
|
51 |
USER ${USER_NAME}
|
52 |
|
53 |
-
|
54 |
-
RUN pip install
|
55 |
|
56 |
-
|
|
|
57 |
|
|
|
|
|
|
|
|
|
58 |
COPY requirements.txt /tmp
|
|
|
59 |
|
60 |
-
|
61 |
-
RUN pip install -U fastapi pydantic
|
62 |
|
|
|
63 |
RUN rm -rf /home/${USER_NAME}/threestudio
|
64 |
RUN rm -rf /home/${USER_NAME}/.cache
|
65 |
|
|
|
66 |
ADD "https://api.github.com/repos/zqh0253/3DitScene/commits?per_page=1" latest_commit
|
67 |
RUN git clone https://github.com/zqh0253/3DitScene.git /home/${USER_NAME}/threestudio --recursive
|
68 |
|
|
|
69 |
WORKDIR /home/${USER_NAME}/threestudio
|
70 |
|
|
|
71 |
RUN wget --quiet https://www.dropbox.com/scl/fi/2s4b848d4qqrz87bbfc2z/cache.zip?rlkey=f7tyf4952ey253xlzvb1lwnmc -O tmp.zip
|
72 |
RUN unzip tmp.zip
|
73 |
|
74 |
-
|
75 |
-
RUN pip install ./submodules/
|
|
|
76 |
|
|
|
77 |
RUN wget --quiet https://www.dropbox.com/scl/fi/rhl1r9qww9fq6jtjmh43x/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl?rlkey=xp02kfjvyk9urnacybp4ll108 -O diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl
|
78 |
-
RUN pip install diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl
|
79 |
-
|
80 |
-
RUN pip install ./submodules/simple-knn
|
81 |
|
82 |
-
#
|
|
|
83 |
|
|
|
84 |
RUN mkdir ckpts
|
85 |
RUN wget --quiet https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth -O ./ckpts/sam_vit_h_4b8939.pth
|
86 |
RUN cp /home/${USER_NAME}/threestudio/submodules/MobileSAM-lang/weights/mobile_sam.pt ./ckpts/
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
CMD ["python", "gradio_app_single_process.py", "--listen", "--hf-space"]
|
|
|
50 |
&& useradd -ms /bin/sh -u ${UID} -g ${GID} ${USER_NAME}
|
51 |
USER ${USER_NAME}
|
52 |
|
53 |
+
# 使用国内镜像源加速 pip 安装
|
54 |
+
RUN pip install --upgrade pip setuptools==69.5.1 ninja -i https://pypi.tuna.tsinghua.edu.cn/simple
|
55 |
|
56 |
+
# 使用国内镜像源安装 PyTorch 和 TorchVision
|
57 |
+
RUN pip install xformers==0.0.22 torch==2.0.1+cu118 torchvision==0.15.2+cu118 -f https://mirrors.aliyun.com/pytorch-wheels/cu118/torch_stable.html
|
58 |
|
59 |
+
# 使用国内镜像源安装 nerfacc
|
60 |
+
RUN pip install nerfacc==0.5.2 -f https://nerfacc-bucket.s3.us-west-2.amazonaws.com/whl/torch-2.0.0_cu118.html -i https://pypi.tuna.tsinghua.edu.cn/simple
|
61 |
+
|
62 |
+
# 复制 requirements.txt 并使用国内镜像源安装依赖
|
63 |
COPY requirements.txt /tmp
|
64 |
+
RUN cd /tmp && pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
65 |
|
66 |
+
# 使用国内镜像源安装 fastapi 和 pydantic
|
67 |
+
RUN pip install -U fastapi pydantic -i https://pypi.tuna.tsinghua.edu.cn/simple
|
68 |
|
69 |
+
# 清理缓存
|
70 |
RUN rm -rf /home/${USER_NAME}/threestudio
|
71 |
RUN rm -rf /home/${USER_NAME}/.cache
|
72 |
|
73 |
+
# 克隆项目仓库
|
74 |
ADD "https://api.github.com/repos/zqh0253/3DitScene/commits?per_page=1" latest_commit
|
75 |
RUN git clone https://github.com/zqh0253/3DitScene.git /home/${USER_NAME}/threestudio --recursive
|
76 |
|
77 |
+
# 设置工作目录
|
78 |
WORKDIR /home/${USER_NAME}/threestudio
|
79 |
|
80 |
+
# 下载并解压文件
|
81 |
RUN wget --quiet https://www.dropbox.com/scl/fi/2s4b848d4qqrz87bbfc2z/cache.zip?rlkey=f7tyf4952ey253xlzvb1lwnmc -O tmp.zip
|
82 |
RUN unzip tmp.zip
|
83 |
|
84 |
+
# 安装子模块
|
85 |
+
RUN pip install ./submodules/segment-anything-langsplat -i https://pypi.tuna.tsinghua.edu.cn/simple
|
86 |
+
RUN pip install ./submodules/MobileSAM-lang -i https://pypi.tuna.tsinghua.edu.cn/simple
|
87 |
|
88 |
+
# 下载并安装 diff_gaussian_rasterization
|
89 |
RUN wget --quiet https://www.dropbox.com/scl/fi/rhl1r9qww9fq6jtjmh43x/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl?rlkey=xp02kfjvyk9urnacybp4ll108 -O diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl
|
90 |
+
RUN pip install diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl -i https://pypi.tuna.tsinghua.edu.cn/simple
|
|
|
|
|
91 |
|
92 |
+
# 安装 simple-knn
|
93 |
+
RUN pip install ./submodules/simple-knn -i https://pypi.tuna.tsinghua.edu.cn/simple
|
94 |
|
95 |
+
# 下载模型权重
|
96 |
RUN mkdir ckpts
|
97 |
RUN wget --quiet https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth -O ./ckpts/sam_vit_h_4b8939.pth
|
98 |
RUN cp /home/${USER_NAME}/threestudio/submodules/MobileSAM-lang/weights/mobile_sam.pt ./ckpts/
|
99 |
|
100 |
+
# 设置默认命令
|
101 |
+
CMD ["python", "gradio_app_single_process.py", "--listen", "--hf-space"]
|
|