-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.runtime
More file actions
105 lines (91 loc) · 3.87 KB
/
Dockerfile.runtime
File metadata and controls
105 lines (91 loc) · 3.87 KB
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
FROM nvidia/cuda:11.8.0-devel-ubuntu20.04
RUN apt update && \
DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends \
python3.8 python3.8-dev python3-pip git wget zip unzip make cmake ninja-build gcc g++ libgl1-mesa-dev libglib2.0-0 \
# COLMAP Dependencies
build-essential libboost-program-options-dev libboost-filesystem-dev libboost-graph-dev libboost-system-dev \
libboost-test-dev libeigen3-dev libflann-dev libfreeimage-dev libmetis-dev libgoogle-glog-dev libgflags-dev \
libsqlite3-dev libglew-dev qtbase5-dev libqt5opengl5-dev libcgal-dev libceres-dev libcgal-qt5-dev \
# I think these are for FFMPEG.
ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libgtk2.0-dev pkg-config \
# Packages for Ceres Solver
libatlas-base-dev libsuitesparse-dev libeigen3-dev \
# BundleFusion
libncurses5-dev libncursesw5-dev \
# Headless rendering with Trimesh \
libgl1-mesa-glx libgl1-mesa-dri xvfb xauth ca-certificates freeglut3-dev \
# For downloading the weights for Lama inpainting \
curl && \
apt -y autoremove && \
apt -y clean && \
apt -y autoclean && \
rm -rf /var/lib/apt/lists/*
## Download and install OpenCV
RUN cd / && \
git clone --depth 1 --branch 3.4.16 https://github.com/opencv/opencv.git && \
cd opencv && \
mkdir -p build && \
cd build && \
# Can add `-D WITH_CUDA=ON` to force build with CUDA extensions enabled, however this adds a lot to the image build time and is not really used in the code anyway.
cmake -D BUILD_EXAMPLES=OFF -D BUILD_opencv_apps=OFF -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF .. && \
cmake --build . -- -j 8 && \
make install && \
cd / && \
rm -rf opencv
## Install COLMAP from source
RUN cd / && \
git clone --depth 1 https://github.com/AnthonyDickson/colmap.git && \
cd colmap && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_CUDA_ARCHITECTURES=all -DGUI_ENABLED=OFF && \
make -j 8 && \
make install && \
cd / && \
rm -rf colmap
# Install the glTF branch of the draco mesh compression library.
RUN git clone --depth 1 --branch gltf_2.0_draco_extension --single-branch https://github.com/google/draco.git draco && \
cd draco && \
git checkout 9f856ab && \
git submodule update --init && \
mkdir build && \
cd build && \
cmake .. -DDRACO_TRANSCODER_SUPPORTED=ON && \
make -j 8 && \
make install && \
cd ../../ && \
rm -rf draco
# Install BundleFusion from source
ENV BUNDLE_FUSION_PATH=/bundle_fusion
ENV BUNDLE_FUSION_BIN=${BUNDLE_FUSION_PATH}/build/bundle_fusion_example
RUN git clone https://github.com/AnthonyDickson/BundleFusion_Ubuntu_Pangolin.git ${BUNDLE_FUSION_PATH} && \
cd ${BUNDLE_FUSION_PATH} && \
git checkout b771cf9 && \
mkdir build && \
cd build && \
cmake -DVISUALIZATION=OFF .. && \
make -j8
ENV WEIGHTS_PATH=/root/.cache/pretrained
ENV COLMAP_VOCAB_PATH=/root/.cache/colmap
RUN mkdir -p ${WEIGHTS_PATH} && mkdir -p ${COLMAP_VOCAB_PATH}
# Download DPT weights
RUN wget https://github.com/intel-isl/DPT/releases/download/1_0/dpt_hybrid_nyu-2ce69ec7.pt -O ${WEIGHTS_PATH}/dpt_hybrid_nyu.pt
# Download weights for lama inpainting.
RUN cd ${WEIGHTS_PATH} && \
curl -LJO https://huggingface.co/smartywu/big-lama/resolve/main/big-lama.zip && \
unzip big-lama.zip && \
rm big-lama.zip
# COLMAP vocab file.
RUN wget https://demuc.de/colmap/vocab_tree_flickr100K_words256K.bin -O ${COLMAP_VOCAB_PATH}/vocab.bin
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY scripts/download_weights.py download_weights.py
RUN python3 download_weights.py && \
rm download_weights.py
# Set environment variables for headless rendering w/ Trimesh.
ENV XVFB_WHD="1920x1080x24"\
DISPLAY=":99" \
LIBGL_ALWAYS_SOFTWARE="1" \
GALLIUM_DRIVER="llvmpipe"
WORKDIR /app
CMD ["python3"]