2
2
3
3
# docker build .
4
4
5
- # Based on CUDA11 .0 & CuDNN8
6
- FROM nvidia/cuda:10.2 -devel-ubuntu18.04
5
+ # Based on CUDA10 .0 & CuDNN7
6
+ FROM nvidia/cuda:10.0-cudnn7 -devel-ubuntu18.04
7
7
8
- # Test connection
9
- RUN apt update --allow-unauthenticated && apt install -y wget && wget www.google.com
8
+ # Set apt-get to automatically retry if a package download fails
9
+ RUN echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/99AcquireRetries
10
+
11
+ # apt update
12
+ RUN apt update --allow-unauthenticated
10
13
11
14
# Install Non-GPU Dependencies.
12
- RUN version="7.0.0-1+cuda10.2 " ; \
15
+ RUN version="7.0.0-1+cuda10.0 " ; \
13
16
apt install -y \
14
17
libnvinfer7=${version} libnvonnxparsers7=${version} libnvparsers7=${version} \
15
18
libnvinfer-plugin7=${version} libnvinfer-dev=${version} libnvonnxparsers-dev=${version} \
16
- libnvparsers-dev=${version} libnvinfer-plugin-dev=${version} python-libnvinfer=${version} \
17
- python3-libnvinfer=${version} && \
19
+ libnvparsers-dev=${version} libnvinfer-plugin-dev=${version} && \
18
20
apt-mark hold \
19
- libnvinfer7 libnvonnxparsers7 libnvparsers7 libnvinfer-plugin7 libnvinfer-dev libnvonnxparsers-dev libnvparsers-dev libnvinfer-plugin-dev python-libnvinfer python3-libnvinfer
20
-
21
- # Set apt-get to automatically retry if a package download fails
22
- RUN echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/99AcquireRetries
21
+ libnvinfer7 libnvonnxparsers7 libnvparsers7 libnvinfer-plugin7 libnvinfer-dev libnvonnxparsers-dev libnvparsers-dev libnvinfer-plugin-dev \
22
+ # && apt install -yt python-libnvinfer=${version} python3-libnvinfer=${version} && apt-mark hold python-libnvinfer python3-libnvinfer
23
23
24
24
# Install OpenCV Dependencies
25
25
RUN apt install -y software-properties-common || apt install -y software-properties-common && \
26
26
add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main" && \
27
- APT_DEPS="git cmake libgtk-3-dev libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev x264 v4l-utils python3-dev python3-pip libcanberra-gtk-module libcanberra-gtk3-module" && \
27
+ APT_DEPS="git cmake wget zip libgtk-3-dev libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev x264 v4l-utils python3-dev python3-pip libcanberra-gtk-module libcanberra-gtk3-module" && \
28
28
apt install -y $APT_DEPS || apt install -y $APT_DEPS && \
29
29
python3 -m pip install numpy
30
30
31
31
# Compile OpenCV
32
- RUN apt install -y zip && wget https://github.com/opencv/opencv/archive/refs/tags/4.4.0.zip && unzip 4.4.0.zip && \
32
+ RUN wget https://github.com/opencv/opencv/archive/refs/tags/4.4.0.zip && unzip 4.4.0.zip && \
33
33
cd opencv-4.4.0 && mkdir build && cd build && \
34
34
cmake .. -DCMAKE_BUILD_TYPE=Release \
35
35
-DCMAKE_INSTALL_PREFIX=/usr/local \
@@ -44,13 +44,17 @@ RUN apt install -y python3-dev python3-pip subversion libgflags-dev
44
44
45
45
COPY . /hyperpose
46
46
47
- # Get models
47
+ # Get models: we first see if there's existing models here. If not install it throught network.
48
48
# NOTE: if you cannot install the models due to network issues:
49
49
# 1 Manually install ONNX and UFF models through: https://drive.google.com/drive/folders/1w9EjMkrjxOmMw3Rf6fXXkiv_ge7M99jR
50
50
# 2 Put all models into `${GIT_DIR}/pre_installed_models`
51
- # 3.1 `RUN /hyperpose/scripts/download-test-data.sh`
52
- # 3.2 `RUN mv /hyperpose/pre_installed_models /hyperpose/data/models`
53
- RUN for file in $(find /hyperpose/scripts -type f -iname 'download*.sh' ); do sh $file; done
51
+ # 3 Re-build this docker image.
52
+ RUN ( [ `find /hyperpose/pre_installed_models -regex '.*\.\( onnx\| uff\) ' | wc -l` > 0 ] && \
53
+ mkdir -p /hyperpose/data && mv /hyperpose/pre_installed_models/ /hyperpose/data/models ) || \
54
+ for file in $(find /hyperpose/scripts -type f -iname 'download-*-model.sh' ); do sh $file; done
55
+
56
+ # Install test data.
57
+ RUN /hyperpose/scripts/download-test-data.sh
54
58
55
59
# Build Repo
56
60
RUN cd hyperpose && mkdir build && cd build && \
0 commit comments