|
| 1 | +FROM tensorflow/tensorflow:latest |
| 2 | + |
| 3 | +RUN apt-get update -y --fix-missing |
| 4 | +RUN apt-get install -y ffmpeg |
| 5 | +RUN apt-get install -y build-essential cmake pkg-config \ |
| 6 | + libjpeg8-dev libtiff5-dev libjasper-dev libpng12-dev \ |
| 7 | + libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \ |
| 8 | + libxvidcore-dev libx264-dev \ |
| 9 | + libgtk-3-dev \ |
| 10 | + libatlas-base-dev gfortran \ |
| 11 | + libboost-all-dev \ |
| 12 | + python3 python3-dev python3-numpy |
| 13 | + |
| 14 | +RUN apt-get install -y wget vim python3-tk python3-pip |
| 15 | + |
| 16 | +WORKDIR / |
| 17 | +RUN wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.2.0.zip \ |
| 18 | + && unzip opencv.zip \ |
| 19 | + && wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/3.2.0.zip \ |
| 20 | + && unzip opencv_contrib.zip |
| 21 | + |
| 22 | +# install opencv3.2 |
| 23 | +RUN cd /opencv-3.2.0/ \ |
| 24 | + && mkdir build \ |
| 25 | + && cd build \ |
| 26 | + && cmake -D CMAKE_BUILD_TYPE=RELEASE \ |
| 27 | + -D INSTALL_C_EXAMPLES=OFF \ |
| 28 | + -D INSTALL_PYTHON_EXAMPLES=ON \ |
| 29 | + -D OPENCV_EXTRA_MODULES_PATH=/opencv_contrib-3.2.0/modules \ |
| 30 | + -D BUILD_EXAMPLES=OFF \ |
| 31 | + -D BUILD_opencv_python2=OFF \ |
| 32 | + -D BUILD_NEW_PYTHON_SUPPORT=ON \ |
| 33 | + -D CMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)") \ |
| 34 | + -D PYTHON_EXECUTABLE=$(which python3) \ |
| 35 | + -D WITH_FFMPEG=1 \ |
| 36 | + -D WITH_CUDA=0 \ |
| 37 | + .. \ |
| 38 | + && make -j8 \ |
| 39 | + && make install \ |
| 40 | + && ldconfig \ |
| 41 | + && rm /opencv.zip \ |
| 42 | + && rm /opencv_contrib.zip |
| 43 | + |
| 44 | + |
| 45 | +# Install dlib 19.4 |
| 46 | +RUN wget -O dlib-19.4.tar.bz2 http://dlib.net/files/dlib-19.4.tar.bz2 \ |
| 47 | + && tar -vxjf dlib-19.4.tar.bz2 |
| 48 | + |
| 49 | +RUN cd dlib-19.4 \ |
| 50 | + && cd examples \ |
| 51 | + && mkdir build \ |
| 52 | + && cd build \ |
| 53 | + && cmake .. \ |
| 54 | + && cmake --build . --config Release \ |
| 55 | + && cd /dlib-19.4 \ |
| 56 | + && pip3 install setuptools \ |
| 57 | + && python3 setup.py install \ |
| 58 | + && cd $WORKDIR \ |
| 59 | + && rm /dlib-19.4.tar.bz2 |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | +ADD $PWD/requirements.txt /requirements.txt |
| 64 | +RUN pip3 install -r /requirements.txt |
| 65 | + |
| 66 | + |
| 67 | +CMD ["/bin/bash"] |
0 commit comments