Last active
November 18, 2018 17:16
-
-
Save moiseevigor/3e9b00066842c20229be47bd5429f6b1 to your computer and use it in GitHub Desktop.
Tensorflow 1.5 + OpenCV 3.4.1 + Python 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM gcr.io/tensorflow/tensorflow:1.5.0-gpu-py3 | |
LABEL maintainer="Igor Moiseev <[email protected]>" | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends \ | |
build-essential \ | |
cmake \ | |
git \ | |
wget \ | |
unzip \ | |
yasm \ | |
pkg-config \ | |
libswscale-dev \ | |
libtbb2 \ | |
libtbb-dev \ | |
libjpeg-dev \ | |
libpng-dev \ | |
libtiff-dev \ | |
libjasper-dev \ | |
libavformat-dev \ | |
libpq-dev \ | |
qtbase5-dev \ | |
python3.5-dev \ | |
python3-tk \ | |
cuda-core-9-0 \ | |
cuda-command-line-tools-9-0 | |
RUN pip install --upgrade pip && \ | |
pip install -U setuptools && \ | |
pip install numpy | |
RUN git clone https://github.com/opencv/opencv.git && \ | |
cd opencv; git checkout 3.4.1; cd .. && \ | |
git clone https://github.com/opencv/opencv_contrib.git && \ | |
cd opencv_contrib; git checkout 3.4.1; cd .. && \ | |
cd opencv; mkdir build; cd build && \ | |
cmake -D CMAKE_BUILD_TYPE=RELEASE \ | |
-D CMAKE_INSTALL_PREFIX=/usr/local \ | |
-D WITH_CUDA=OFF \ | |
-D WITH_TBB=ON \ | |
-D WITH_V4L=ON \ | |
-D WITH_QT=ON \ | |
-D WITH_OPENGL=ON \ | |
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules .. && \ | |
make -j`nproc` && \ | |
make install && \ | |
sh -c 'echo "/usr/local/lib" >> /etc/ld.so.conf.d/opencv.conf' && \ | |
ldconfig && \ | |
cd / && rm -rf opencv* | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment