Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 66c70f7

Browse files
committed
success with 2021.3
1 parent 7a57a8d commit 66c70f7

7 files changed

Lines changed: 93 additions & 117 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# opencv-python-inference-engine
44

5-
This is *Unofficial* pre-built OpenCV with the inference engine part of [dldt module](https://github.com/opencv/dldt/) package for Python.
5+
This is *Unofficial* pre-built OpenCV with the inference engine part of [OpenVINO](https://github.com/openvinotoolkit/openvino) package for Python.
66

77
## Installing from `pip3`
88

@@ -23,23 +23,23 @@ You will need to preprocess data as a model requires and decode the output. A de
2323

2424
The official way is clumsy because you need to git clone the whole [model_zoo](https://github.com/opencv/open_model_zoo) ([details](https://github.com/opencv/open_model_zoo/issues/522))
2525

26-
Better to find a model description [here](https://github.com/opencv/open_model_zoo/blob/master/models/intel/index.md) and download manually from [here](https://download.01.org/opencv/2020/openvinotoolkit/2020.1/open_model_zoo/models_bin/1/)
26+
Better to find a model description [here](https://github.com/opencv/open_model_zoo/blob/master/models/intel/index.md) and download manually from [here](https://download.01.org/opencv/2021/openvinotoolkit/2021.2/open_model_zoo/models_bin/3/)
2727

2828

2929
## Description
3030

3131

3232
### Why
3333

34-
I needed an ability to fast deploy a small package that able to run models from [Intel's model zoo](https://github.com/opencv/open_model_zoo/) and use [Movidius NCS](https://software.intel.com/en-us/neural-compute-stick).
34+
I needed an ability to fast deploy a small package that able to run models from [Intel's model zoo](https://github.com/openvinotoolkit/open_model_zoo) and use [Movidius NCS](https://software.intel.com/en-us/neural-compute-stick).
3535
Well-known [opencv-python](https://github.com/skvark/opencv-python) can't do this.
3636
The official way is to use OpenVINO, but it is big and clumsy (just try to use it with python venv or fast download it on cloud instance).
3737

3838

3939
### Limitations
4040

4141
+ Package comes without contrib modules.
42-
+ You need to [add udev rules](https://github.com/opencv/dldt/blob/2019/inference-engine/README.md#for-linux-raspbian-stretch-os) if you want working MYRIAD plugin.
42+
+ You need to [add udev rules](https://www.intel.com/content/www/us/en/support/articles/000057005/boards-and-kits.html) if you want working MYRIAD plugin.
4343
+ It was tested on Ubuntu 18.04, Ubuntu 18.10 as Windows 10 Subsystem and Gentoo.
4444
+ It will not work for Ubuntu 16.04 and below (except v4.1.0.4).
4545
+ I had not made builds for Windows or MacOS.
@@ -89,7 +89,7 @@ From [opencv](https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html)
8989
[ffmpeg](https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu), [openBLAS](https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu) and [ngraph](https://www.ngraph.ai/documentation/buildlb)
9090

9191
+ `build-essential`
92-
+ `>=cmake-3.11`
92+
+ `>=cmake-3.16`
9393
+ `autoconf` (for ngraph)
9494
+ `libtool-bin` (for ngraph)
9595
+ `git`
@@ -174,8 +174,8 @@ for i in cv2/*.so; do chrpath -r '$ORIGIN' $i; done
174174

175175
### Optional things to play with
176176

177-
+ [dldt build instruction](https://github.com/opencv/dldt/blob/2020/build-instruction.md)
178-
+ [dldt cmake flags](https://github.com/opencv/dldt/blob/b2140c083a068a63591e8c2e9b5f6b240790519d/inference-engine/cmake/features_ie.cmake)
177+
+ [dldt build instruction](https://github.com/openvinotoolkit/openvino/wiki/CMakeOptionsForCustomCompilation)
178+
+ [dldt cmake flags](https://github.com/openvinotoolkit/openvino/blob/master/inference-engine/cmake/features.cmake)
179179
+ [opencv cmake flags](https://github.com/opencv/opencv/blob/master/CMakeLists.txt)
180180

181181
**NB:** removing `QUIET` from `find_package()` in project Cmake files, could help to solve some problems -- сmake will start to log them.

TODO.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22

33
+ get rid of tensorflow-cpu in tests
44
+ Auto value for `-D INF_ENGINE_RELEASE`: https://github.com/openvinotoolkit/openvino/issues/1435
5-
+ https://answers.opencv.org/question/236271/what-the-difference-between-cv_version_status-values/
5+
+ <https://answers.opencv.org/question/236271/what-the-difference-between-cv_version_status-values/>
6+
+ `ENABLE_AVX512F`, how often you see such CPUs in clouds?
7+
+ `avresample` from ffmpeg to the opencv, do we need it?
8+
+ `se_net.xml` downloads badly
9+
+ results of `test_inference_engine()[::-1]`

build/dldt/dependencies.patch

Lines changed: 0 additions & 22 deletions
This file was deleted.

build/dldt/dldt_setup.sh

Lines changed: 33 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,50 @@
11
#!/bin/bash
22

3-
# GEMM (General matrix-matrix multiplication)
4-
#
5-
# -D BUILD_SHARED_LIBS=ON always crash
6-
73
tmp=$(pwd)
84
BLAS_LIB="${tmp%dldt}openblas/lib/libopenblas.so.0"
95
BLAS_INC="${tmp%dldt}openblas/include/openblas"
106

11-
#if [ ! -f $BLAS_LIB ] || [ ! -d $BLAS_INC ]; then
12-
# echo "!!! Check paths for openblas lib !!!"
13-
# echo "I tried: $BLAS_LIB and $BLAS_INC"
14-
# exit
15-
#fi
16-
17-
# <https://github.com/openvinotoolkit/openvino/issues/4527>
18-
# look for proper values at <https://download.01.org/opencv/master/openvinotoolkit/thirdparty/linux/opencv/>
19-
# calculate hash256 manually
20-
#patch ../../dldt/inference-engine/cmake/dependencies.cmake dependencies.patch
21-
7+
if [ ! -f $BLAS_LIB ] || [ ! -d $BLAS_INC ]; then
8+
echo "!!! Check paths for openblas lib !!!"
9+
echo "I tried: $BLAS_LIB and $BLAS_INC"
10+
exit
11+
fi
2212

23-
# Manually-specified variables were not used by the project:
24-
# -D ENABLE_NGRAPH=ON \
13+
# https://github.com/openvinotoolkit/openvino/wiki/CMakeOptionsForCustomCompilation
14+
# https://github.com/openvinotoolkit/openvino/issues/4527
15+
# -D ENABLE_OPENCV=OFF \
16+
# https://github.com/openvinotoolkit/openvino/issues/5100
17+
# -D BUILD_SHARED_LIBS=OFF \
18+
# -D BUILD_SHARED_LIBS=ON \
2519
cmake -D CMAKE_BUILD_TYPE=Release \
26-
-D ENABLE_LTO=ON \
27-
-D GEMM=JIT \
2820
-D THREADING=TBB \
21+
-D ENABLE_MKL_DNN=ON \
22+
-D GEMM=OPENBLAS \
23+
-D BLAS_INCLUDE_DIRS="$BLAS_INC" \
24+
-D BLAS_LIBRARIES="$BLAS_LIB" \
25+
-D ENABLE_FASTER_BUILD=ON \
26+
-D ENABLE_LTO=ON \
2927
-D ENABLE_VPU=ON \
3028
-D ENABLE_MYRIAD=ON \
31-
-D ENABLE_OPENCV=OFF \
32-
-D ENABLE_MKL_DNN=ON \
33-
-D BUILD_SHARED_LIBS=OFF \
34-
-D BUILD_TESTS=OFF \
35-
-D ENABLE_PYTHON=OFF \
36-
-D ENABLE_TESTS=OFF \
37-
-D ENABLE_DOCS=OFF \
38-
-D ENABLE_SAMPLES=OFF \
39-
-D ENABLE_GAPI_TESTS=OFF \
40-
-D GAPI_TEST_PERF=OFF \
41-
-D ENABLE_GNA=OFF \
42-
-D ENABLE_PROFILING_ITT=OFF \
43-
-D ENABLE_ALTERNATIVE_TEMP=OFF \
4429
-D ENABLE_SSE42=ON \
4530
-D ENABLE_AVX2=ON \
4631
-D ENABLE_AVX512F=OFF \
47-
-D NGRAPH_UNIT_TEST_ENABLE=OFF \
48-
-D NGRAPH_TEST_UTIL_ENABLE=OFF \
49-
-D NGRAPH_ONNX_IMPORT_ENABLE=ON \
50-
-D BLAS_LIBRARIES="$BLAS_LIB" \
51-
-D BLAS_INCLUDE_DIRS="$BLAS_INC" \
32+
-D BUILD_TESTS=OFF \
33+
-D ENABLE_ALTERNATIVE_TEMP=OFF \
5234
-D ENABLE_CLDNN=OFF \
5335
-D ENABLE_CLDNN_TESTS=OFF \
36+
-D ENABLE_DOCS=OFF \
37+
-D ENABLE_GAPI_TESTS=OFF \
38+
-D ENABLE_GNA=OFF \
39+
-D ENABLE_OPENCV=OFF \
5440
-D ENABLE_PROFILING_ITT=OFF \
55-
-D SELECTIVE_BUILD=OFF \
56-
-D ENABLE_SPEECH_DEMO=OFF ../../dldt/
41+
-D ENABLE_PYTHON=OFF \
42+
-D ENABLE_SAMPLES=OFF \
43+
-D ENABLE_SPEECH_DEMO=OFF \
44+
-D ENABLE_TESTS=OFF \
45+
-D GAPI_TEST_PERF=OFF \
46+
-D NGRAPH_ONNX_IMPORT_ENABLE=ON \
47+
-D NGRAPH_TEST_UTIL_ENABLE=OFF \
48+
-D NGRAPH_TOOLS_ENABLE=OFF \
49+
-D NGRAPH_UNIT_TEST_ENABLE=OFF \
50+
-D SELECTIVE_BUILD=OFF ../../dldt/

build/opencv/opencv_setup.sh

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -22,61 +22,61 @@ PY_LIB_PATH=`find $ABS_PORTION/venv/lib/ -iname libpython3.${PY_VER}m.so`
2222

2323

2424
cmake -D CMAKE_BUILD_TYPE=RELEASE \
25+
-D BUILD_DOCS=OFF \
26+
-D BUILD_EXAMPLES=OFF \
27+
-D BUILD_JPEG=OFF \
28+
-D BUILD_JPEG=OFF \
29+
-D BUILD_PERF_TESTS=OFF \
30+
-D BUILD_SHARED_LIBS=OFF \
31+
-D BUILD_TESTS=OFF \
32+
-D BUILD_opencv_apps=OFF \
33+
-D BUILD_opencv_java=OFF \
34+
-D BUILD_opencv_python2.7=OFF \
35+
-D BUILD_opencv_python2=OFF \
36+
-D BUILD_opencv_python3=ON \
37+
-D BUILD_opencv_world=OFF \
38+
-D CMAKE_INSTALL_PREFIX=./binaries/ \
39+
-D CPU_BASELINE=SSE4_2 \
40+
-D CPU_DISPATCH=AVX,AVX2,FP16,AVX512 \
41+
-D CV_TRACE=OFF \
42+
-D ENABLE_CXX11=ON \
43+
-D ENABLE_PRECOMPILED_HEADERS=OFF \
44+
-D FFMPEG_INCLUDE_DIRS=$FFMPEG_PATH/include \
45+
-D INF_ENGINE_INCLUDE_DIRS=$ABS_PORTION/dldt/inference-engine/include \
46+
-D INF_ENGINE_LIB_DIRS=$ABS_PORTION/dldt/bin/intel64/Release/lib \
47+
-D INF_ENGINE_RELEASE=2021030000 \
48+
-D INSTALL_CREATE_DISTRIB=ON \
49+
-D INSTALL_C_EXAMPLES=OFF \
50+
-D INSTALL_PYTHON_EXAMPLES=OFF \
51+
-D JPEG_INCLUDE_DIR=$JPEG_INCLUDE_DIR \
52+
-D JPEG_LIBRARY=$JPEG_LIBRARY \
53+
-D OPENCV_ENABLE_NONFREE=OFF \
2554
-D OPENCV_FORCE_3RDPARTY_BUILD=ON \
2655
-D OPENCV_SKIP_PYTHON_LOADER=ON \
27-
-D BUILD_opencv_python3=ON \
2856
-D PYTHON3_EXECUTABLE=$ABS_PORTION/venv/bin/python3 \
2957
-D PYTHON3_LIBRARY:PATH=$PY_LIB_PATH \
3058
-D PYTHON3_NUMPY_INCLUDE_DIRS:PATH=$ABS_PORTION/venv/lib/python3.${PY_VER}/site-packages/numpy/core/include \
31-
-D PYTHON_DEFAULT_EXECUTABLE=$ABS_PORTION/venv/bin/python3 \
3259
-D PYTHON3_PACKAGES_PATH=$ABS_PORTION/venv/lib/python3.${PY_VER}/site-packages \
60+
-D PYTHON_DEFAULT_EXECUTABLE=$ABS_PORTION/venv/bin/python3 \
3361
-D PYTHON_INCLUDE_DIR=/usr/include/python3.${PY_VER} \
34-
-D INSTALL_CREATE_DISTRIB=ON \
35-
-D ENABLE_CXX11=ON \
36-
-D WITH_V4L=ON \
37-
-D WITH_PNG=ON \
62+
-D WITH_1394=OFF \
63+
-D WITH_CUDA=OFF \
64+
-D WITH_EIGEN=OFF \
3865
-D WITH_FFMPEG=ON \
39-
-D FFMPEG_INCLUDE_DIRS=$FFMPEG_PATH/include \
40-
-D CMAKE_INSTALL_PREFIX=./binaries/ \
41-
-D WITH_TBB=ON \
42-
-D WITH_PROTOBUF=ON \
43-
-D JPEG_INCLUDE_DIR=$JPEG_INCLUDE_DIR \
44-
-D JPEG_LIBRARY=$JPEG_LIBRARY \
66+
-D WITH_GSTRREAMER=OFF \
4567
-D WITH_GTK=OFF \
46-
-D BUILD_opencv_python2=OFF \
47-
-D BUILD_opencv_python2.7=OFF \
48-
-D BUILD_SHARED_LIBS=OFF \
49-
-D BUILD_opencv_world=OFF \
50-
-D INSTALL_PYTHON_EXAMPLES=OFF \
51-
-D INSTALL_C_EXAMPLES=OFF \
52-
-D OPENCV_ENABLE_NONFREE=OFF \
53-
-D BUILD_EXAMPLES=OFF \
54-
-D BUILD_opencv_java=OFF \
55-
-D BUILD_opencv_apps=OFF \
56-
-D CV_TRACE=OFF \
57-
-D BUILD_TESTS=OFF \
58-
-D BUILD_PERF_TESTS=OFF \
59-
-D BUILD_DOCS=OFF \
60-
-D WITH_QT=OFF \
61-
-D ENABLE_PRECOMPILED_HEADERS=OFF \
62-
-D BUILD_JPEG=OFF \
68+
-D WITH_INF_ENGINE=ON \
69+
-D WITH_IPP=OFF \
70+
-D WITH_ITT=OFF \
6371
-D WITH_JASPER=OFF \
64-
-D WITH_WEBP=OFF \
65-
-D WITH_1394=OFF \
66-
-D WITH_GSTRREAMER=OFF \
72+
-D WITH_NGRAPH=ON \
6773
-D WITH_OPENEXR=OFF \
6874
-D WITH_OPENMP=OFF \
69-
-D WITH_EIGEN=OFF \
75+
-D WITH_PNG=ON \
76+
-D WITH_PROTOBUF=ON \
77+
-D WITH_QT=OFF \
78+
-D WITH_TBB=ON \
79+
-D WITH_V4L=ON \
7080
-D WITH_VTK=OFF \
71-
-D BUILD_JPEG=OFF \
72-
-D WITH_CUDA=OFF \
73-
-D WITH_ITT=OFF \
74-
-D WITH_IPP=OFF \
75-
-D WITH_NGRAPH=ON \
76-
-D ngraph_DIR=$ABS_PORTION/build/dldt/ngraph \
77-
-D WITH_INF_ENGINE=ON \
78-
-D INF_ENGINE_RELEASE=2021030000 \
79-
-D INF_ENGINE_INCLUDE_DIRS=$ABS_PORTION/dldt/inference-engine/include \
80-
-D INF_ENGINE_LIB_DIRS=$ABS_PORTION/dldt/bin/intel64/Release/lib \
81-
-D CPU_BASELINE=SSE4_2 \
82-
-D CPU_DISPATCH=AVX,AVX2,FP16,AVX512 ../../opencv
81+
-D WITH_WEBP=OFF \
82+
-D ngraph_DIR=$ABS_PORTION/build/dldt/ngraph ../../opencv

create_wheel/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# README
22

3-
This is a pre-built [OpenCV](https://github.com/opencv/opencv) with [dldt](https://github.com/opencv/dldt) module package for Python3.
4-
You need that module if you want to run models from [Intel's model zoo](https://github.com/opencv/open_model_zoo/).
3+
This is a pre-built [OpenCV](https://github.com/opencv/opencv) with [Inference Engine](https://github.com/openvinotoolkit/openvino) module package for Python3.
4+
You need that module if you want to run models from [Intel's model zoo](https://github.com/openvinotoolkit/open_model_zoo).
55

66
It built with `ffmpeg` and `v4l` but without GTK/QT (use matplotlib for plotting your results).
77
Contrib modules and haarcascades are not included.

create_wheel/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def __len__(self):
1515

1616
setuptools.setup(
1717
name='opencv-python-inference-engine',
18-
version='2021.04.04',
18+
version='2021.04.13',
1919
url="https://github.com/banderlog/opencv-python-inference-engine",
2020
maintainer="Kabakov Borys",
2121
license='MIT, Apache 2.0',

0 commit comments

Comments
 (0)