-
Notifications
You must be signed in to change notification settings - Fork 1
/
opencv.sh
executable file
·76 lines (67 loc) · 1.9 KB
/
opencv.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
OPENCV_VERSION=4.3.0
cd
apt-get update
apt-get remove -y ffmpeg x264 libx264-dev
apt-get install -y \
build-essential \
cmake \
libjack-jackd2-dev \
libmp3lame-dev \
libopencore-amrnb-dev \
libopencore-amrwb-dev \
libsdl1.2-dev \
libtheora-dev \
libva-dev \
libvdpau-dev \
libvorbis-dev \
libx11-dev \
libxfixes-dev \
libxvidcore-dev \
texi2html \
zlib1g-dev \
wget \
unzip \
yasm \
pkg-config \
libswscale-dev \
libtbb2 \
libtbb-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libavformat-dev \
libpq-dev
apt-get remove -y x264 ffmpeg libx264-dev && \
apt-get install -y x264 libx264-dev && \
apt-get install -y ffmpeg
wget https://github.com/opencv/opencv/archive/$OPENCV_VERSION.zip && \
unzip $OPENCV_VERSION.zip && \
mkdir opencv-$OPENCV_VERSION/build
cd opencv-$OPENCV_VERSION/build
cmake \
-DBUILD_TIFF=ON \
-DBUILD_opencv_java=OFF \
-DWITH_CUDA=OFF \
-DWITH_OPENGL=ON \
-DWITH_OPENCL=ON \
-DWITH_IPP=ON \
-DWITH_TBB=ON \
-DWITH_EIGEN=ON \
-DWITH_V4L=ON \
-DBUILD_TESTS=OFF \
-DBUILD_PERF_TESTS=OFF \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=$(python -c "import sys; print(sys.prefix)") \
-DPYTHON_EXECUTABLE=$(which python) \
-DPYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-DPYTHON_PACKAGES_PATH=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
-DPYTHON_DEFAULT_EXECUTABLE=$(which python) \
-DBUILD_NEW_PYTHON_SUPPORT=ON \
-DBUILD_opencv_python3=ON \
-DHAVE_opencv_python3=ON \
-DBUILD_opencv_gapi=OFF \
-DPYTHON3_NUMPY_INCLUDE_DIRS=~/anaconda3/envs/deepfake/lib/python3.6/site-packages/numpy/core/include \
.. \
&& make install
cp ./lib/python3/cv2.cpython-36m-x86_64-linux-gnu.so ~/anaconda3/envs/deepfake/lib/python3.6/site-packages/cv2.so
apt clean