22
33# docker build .
44
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
77
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
1013
1114# Install Non-GPU Dependencies.
12- RUN version="7.0.0-1+cuda10.2 " ; \
15+ RUN version="7.0.0-1+cuda10.0 " ; \
1316 apt install -y \
1417 libnvinfer7=${version} libnvonnxparsers7=${version} libnvparsers7=${version} \
1518 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} && \
1820 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
2323
2424# Install OpenCV Dependencies
2525RUN apt install -y software-properties-common || apt install -y software-properties-common && \
2626 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" && \
2828 apt install -y $APT_DEPS || apt install -y $APT_DEPS && \
2929 python3 -m pip install numpy
3030
3131# 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 && \
3333 cd opencv-4.4.0 && mkdir build && cd build && \
3434 cmake .. -DCMAKE_BUILD_TYPE=Release \
3535 -DCMAKE_INSTALL_PREFIX=/usr/local \
@@ -44,13 +44,17 @@ RUN apt install -y python3-dev python3-pip subversion libgflags-dev
4444
4545COPY . /hyperpose
4646
47- # Get models
47+ # Get models: we first see if there's existing models here. If not install it throught network.
4848# NOTE: if you cannot install the models due to network issues:
4949# 1 Manually install ONNX and UFF models through: https://drive.google.com/drive/folders/1w9EjMkrjxOmMw3Rf6fXXkiv_ge7M99jR
5050# 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
5458
5559# Build Repo
5660RUN cd hyperpose && mkdir build && cd build && \
0 commit comments