-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile
152 lines (119 loc) · 3.95 KB
/
Dockerfile
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
FROM tensorflow/tensorflow:1.15.2-gpu-py3
WORKDIR /
# Fix for GPG key error (see https://github.com/NVIDIA/nvidia-docker/issues/1632)
RUN rm /etc/apt/sources.list.d/cuda.list
RUN rm /etc/apt/sources.list.d/nvidia-ml.list
# OpenCV & matplotlib dependencies
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
libsm6 \
libxext6 \
libxrender-dev \
python3-tk && \
rm -rf /var/lib/apt/lists/*
# Install Python packages
COPY requirements.txt /
RUN pip3 install --upgrade pip
RUN pip3 install -r /requirements.txt
##############################################################################
#
# Pangolin Viewer
#
##############################################################################
# Install pangoling dependencies
RUN apt-get update && \
apt-get install -y \
git \
pkg-config \
libgl1-mesa-dev \
libglew-dev \
cmake \
libpython2.7-dev \
libegl1-mesa-dev \
libwayland-dev \
libxkbcommon-dev \
wayland-protocols \
libeigen3-dev \
doxygen && \
rm -rf /var/lib/apt/lists/*
RUN python3 -m pip install pyopengl Pillow pybind11
WORKDIR /home
RUN git clone https://github.com/lukasbommes-forked-projects/Pangolin.git pangolin
WORKDIR /home/pangolin
RUN git submodule init && git submodule update
WORKDIR /home/pangolin/build
RUN cmake .. && \
cmake --build . && \
cmake --build . --target doc
ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics
###############################################################################
#
# Install OpenSfM dependencies
#
###############################################################################
ARG DEBIAN_FRONTEND=noninteractive
# Install apt-getable dependencies
RUN apt-get update \
&& apt-get install -y \
build-essential \
cmake \
libeigen3-dev \
libgoogle-glog-dev \
libopencv-dev \
libsuitesparse-dev \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install Ceres 2
RUN \
mkdir -p /source && cd /source && \
curl -L http://ceres-solver.org/ceres-solver-2.0.0.tar.gz | tar xz && \
cd /source/ceres-solver-2.0.0 && \
mkdir -p build && cd build && \
cmake .. -DCMAKE_C_FLAGS=-fPIC -DCMAKE_CXX_FLAGS=-fPIC -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF && \
make -j4 install && \
cd / && rm -rf /source/ceres-solver-2.0.0
##############################################################################
#
# pyg2o hyper graph optimizer
#
##############################################################################
RUN apt-get update && \
apt-get install -y \
cmake \
git \
build-essential \
libeigen3-dev \
libsuitesparse-dev \
qtdeclarative5-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /code
RUN git clone https://github.com/lukasbommes-forked-projects/g2opy.git
WORKDIR /code/g2opy/build
RUN cmake .. \
&& make -j12 \
&& make install -j12 \
&& ldconfig
WORKDIR /code/g2opy/
RUN python setup.py install
WORKDIR /code/g2opy
###############################################################################
#
# Setup OpenSfM
#
###############################################################################
COPY ./extractor/mapping/OpenSfM /pvextractor/extractor/mapping/OpenSfM
WORKDIR /pvextractor/extractor/mapping/OpenSfM
RUN python setup.py build
WORKDIR /pvextractor
###############################################################################
#
# Setup Mask R-CNN
#
###############################################################################
COPY ./extractor/segmentation/Mask_RCNN /pvextractor/extractor/segmentation/Mask_RCNN
WORKDIR /pvextractor/extractor/segmentation/Mask_RCNN
RUN python setup.py install
WORKDIR /pvextractor