Last active
July 24, 2017 06:04
Install opencv in official tensorflow docker: gcr.io/tensorflow/tensorflow:latest-gpu
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
#!/bin/bash | |
apt-get -y update | |
apt-get -y upgrade | |
apt-get -y install build-essential cmake pkg-config git | |
apt-get -y install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev | |
apt-get -y install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev | |
apt-get -y install libgtk2.0-dev | |
apt-get -y install libtbb-dev | |
apt-get -y install libatlas-base-dev gfortran | |
cd / | |
git clone https://github.com/Itseez/opencv.git | |
cd opencv | |
git checkout 3.2.0 | |
cd / | |
git clone https://github.com/Itseez/opencv_contrib.git | |
cd opencv_contrib | |
git checkout 3.2.0 | |
export CUDA_CUDA_LIBRARY=/usr/local/cuda/lib64/ | |
cd /opencv | |
mkdir build | |
cd build | |
cmake -DCUDA_CUDA_LIBRARY=/usr/local/cuda/lib64/stubs/libcuda.so\ | |
-D CMAKE_BUILD_TYPE=RELEASE \ | |
-D CMAKE_INSTALL_PREFIX=/usr/local \ | |
-D INSTALL_C_EXAMPLES=OFF \ | |
-D INSTALL_PYTHON_EXAMPLES=ON \ | |
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \ | |
-D BUILD_EXAMPLES=ON .. | |
make -j8 | |
make install | |
ldconfig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment