Spaces:
Paused
Paused
File size: 4,148 Bytes
305ab14 fb10185 305ab14 162a071 305ab14 c95d7f4 305ab14 09ff3c2 305ab14 f0ed3d7 305ab14 cd647ea 305ab14 316df83 305ab14 316df83 305ab14 4be1769 305ab14 162a071 305ab14 2ff2810 305ab14 8777284 305ab14 162a071 305ab14 e201f66 dc8f3d2 6fb43d5 305ab14 e201f66 305ab14 3ba8a36 305ab14 d246c6a 305ab14 4be1769 a4f328c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | # # Use the pre-built PyTorch Docker image with CUDA
# FROM pytorch/pytorch:2.1.2-cuda11.8-cudnn8-devel
# # Install build deps
# RUN apt-get update -y && apt-get install -y wget git vim ninja-build \
# && apt-get clean && rm -f /var/lib/apt/lists/*_*
# # Set up environment variables
# ENV CUDA_HOME=/usr/local/cuda
# # ENV CONDA_DIR=/opt/conda
# # ENV PATH=$CONDA_DIR/bin:$PATH
# # Set CUDA architecture flags
# ENV TORCH_CUDA_ARCH_LIST="7.0;7.5;8.0;8.6"
# WORKDIR /app
# # Clone the InstantSplat repository and download the pre-trained model
# RUN git clone --recursive https://github.com/NVlabs/InstantSplat.git . && \
# git submodule update --init --recursive && \
# cd submodules/dust3r/ && \
# mkdir -p checkpoints/ && \
# wget https://download.europe.naverlabs.com/ComputerVision/DUSt3R/DUSt3R_ViTLarge_BaseDecoder_512_dpt.pth -P checkpoints/
# RUN pip install submodules/simple-knn && \
# sed -i '154s/p_view.z <= 0.2f/p_view.z <= 0.001f/' submodules/diff-gaussian-rasterization/cuda_rasterizer/auxiliary.h && \
# pip install submodules/diff-gaussian-rasterization && \
# cd submodules/dust3r/croco/models/curope/ && \
# python setup.py build_ext --inplace
# # Create the conda environment and install dependencies
# # RUN conda update -n base -c defaults conda
# # RUN conda create -n instantsplat python=3.11 cmake=3.14.0 -y && \
# # echo "source activate instantsplat" > ~/.bashrc && \
# # /bin/bash -c "source activate instantsplat" && \
# # conda install pytorch torchvision pytorch-cuda=11.8 -c pytorch -c nvidia -y && \
# # cd InstantSplat && \
# # pip install -r requirements.txt && \
# # pip install submodules/simple-knn && \
# # sed -i '154s/p_view.z <= 0.2f/p_view.z <= 0.001f/' submodules/diff-gaussian-rasterization/cuda_rasterizer/auxiliary.h && \
# # pip install submodules/diff-gaussian-rasterization
# RUN pip install -r requirements.txt
# RUN pip install imageio[ffmpeg]
# # Set the working directory
# RUN useradd -m -u 1000 user
# RUN chown -R user:user /app
# USER user
# COPY --chown=user . /app
# # COPY --chown=user ./requirements.txt requirements.txt
# # COPY ./requirements.txt requirements.txt
# ENV PATH="/home/user/.local/bin:$PATH"
# # COPY --chown=user ./run_train_infer.sh run_train_infer.sh
# # COPY ./run_train_infer.sh run_train_infer.sh
# RUN chmod +x run_train_infer.sh
# # Default command to run when the container starts
# # CMD ["/bin/bash", "run_train_infer.sh"]
# # Copy the current directory contents into the container at $HOME/app setting the owner to the user
# CMD ["python", "app.py"]
FROM pytorch/pytorch:2.1.2-cuda11.8-cudnn8-devel
ARG DEBIAN_FRONTEND=noninteractive
ARG FORCE_CUDA=1
ENV FORCE_CUDA=${FORCE_CUDA}
ENV NVIDIA_VISIBLE_DEVICES \
${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES \
${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics
RUN apt-get update -y && apt-get install -y git wget
WORKDIR /
RUN git clone --recursive https://github.com/NVlabs/InstantSplat.git &&\
cd InstantSplat &&\
git submodule update --init --recursive &&\
cd submodules/dust3r/ &&\
mkdir -p checkpoints/ &&\
wget https://download.europe.naverlabs.com/ComputerVision/DUSt3R/DUSt3R_ViTLarge_BaseDecoder_512_dpt.pth -P checkpoints/
WORKDIR /InstantSplat
RUN pip3 install -r requirements.txt
ARG TORCH_CUDA_ARCH_LIST="3.5;5.0;6.0;6.1;7.0;7.5;8.0;8.6+PTX"
RUN pip3 install submodules/simple-knn
RUN sed -i 's/p_view.z <= 0.2f/p_view.z <= 0.001f/g' /InstantSplat/submodules/diff-gaussian-rasterization/cuda_rasterizer/auxiliary.h
RUN pip3 install submodules/diff-gaussian-rasterization
RUN cd submodules/dust3r/croco/models/curope/ &&\
python3 setup.py build_ext --inplace
RUN pip3 install plyfile
RUN pip3 install imageio[ffmpeg]
RUN apt-get install -y libgl1-mesa-dev libglib2.0-0
RUN apt-get install -y tree
ENV CUDA_VISIBLE_DEVICES=0
ENV MKL_THREADING_LAYER=GNU
ENV MKL_SERVICE_FORCE_INTEL=1
RUN useradd -m -u 1000 user
RUN chown -R user:user /InstantSplat
USER user
COPY --chown=user . /InstantSplat
CMD ["python", "app.py"] |