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

Commit ce216ee

Browse files
authored
New version: 4.5.0 + 2021.1
* upd new version * OpenBLAS faster than JIT * wheel already manylinux and should not be used for win * upd * upd * 4.4.0 ready * submodules test (#11) * Update TODO.md * tensorflow-cpu==2.2.0 -> tensorflow-cpu==2.2.1 * preparations for new version * all set. waiting for opencv-4.5.0 * upd README.md * opencv 4.5.0 is here
1 parent 5f0a808 commit ce216ee

File tree

17 files changed

+49
-55
lines changed

17 files changed

+49
-55
lines changed

.gitmodules

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[submodule "dldt"]
2+
path = dldt
3+
url = https://github.com/openvinotoolkit/openvino
4+
[submodule "opencv"]
5+
path = opencv
6+
url = https://github.com/opencv/opencv
7+
[submodule "openblas"]
8+
path = openblas
9+
url = https://github.com/xianyi/OpenBLAS
10+
[submodule "ffmpeg"]
11+
path = ffmpeg
12+
url = https://github.com/FFmpeg/FFmpeg

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pip3 install opencv-python-inference-engine
1616
## Why
1717

1818
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).
19-
Wellr-known [opencv-python](https://github.com/skvark/opencv-python) can't do this.
19+
Well-known [opencv-python](https://github.com/skvark/opencv-python) can't do this.
2020
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).
2121

2222

@@ -68,7 +68,7 @@ Better to find a model description [here](https://github.com/opencv/open_model_z
6868

6969
## Compiling from source
7070

71-
You will need ~6GB RAM and ~10GB disk space
71+
You will need ~7GB RAM and ~10GB disk space
7272

7373
I am using Ubuntu 18.04 [multipass](https://multipass.run/) instance: `multipass launch -c 6 -d 10G -m 7G`.
7474

@@ -91,11 +91,12 @@ From [opencv](https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html)
9191

9292
```bash
9393
# We need newer `cmake` for dldt (commands from <https://apt.kitware.com/>)
94-
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add -
95-
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
94+
sudo apt remove --purge cmake
95+
hash -r
96+
sudo snap install cmake --classic
9697

9798
sudo apt-get update
98-
sudo apt install build-essential cmake git pkg-config python3-dev nasm python3 virtualenv libusb-1.0-0-dev chrpath autoconf libtool-bin
99+
sudo apt install build-essential git pkg-config python3-dev nasm python3 virtualenv libusb-1.0-0-dev chrpath autoconf libtool-bin
99100

100101
# for ngraph
101102
# the `dldt/_deps/ext_onnx-src/onnx/gen_proto.py` has `#!/usr/bin/env python` string and will throw an error otherwise
@@ -104,9 +105,11 @@ sudo ln -s /usr/bin/python3 /usr/bin/python
104105

105106
### Preparing
106107

107-
1. `git clone https://github.com/banderlog/opencv-python-inference-engine`
108-
2. `cd opencv-python-inference-engine`
109-
3. run `download_all_stuff.sh` (refer for script code for details)
108+
```bash
109+
git clone https://github.com/banderlog/opencv-python-inference-engine
110+
cd opencv-python-inference-engine
111+
./download_all_stuff.sh
112+
```
110113

111114
### Compilation
112115

@@ -126,6 +129,8 @@ cd ../dldt
126129
./dldt_setup.sh &&
127130
make -j6
128131

132+
# NB: check `-D INF_ENGINE_RELEASE` value
133+
# should be in form YYYYAABBCC (e.g. 2020.1.0.2 -> 2020010002)")
129134
cd ../opencv
130135
./opencv_setup.sh &&
131136
make -j6
@@ -152,6 +157,7 @@ cd create_wheel
152157
for i in cv2/*.so; do chrpath -r '$ORIGIN' $i; done
153158

154159
# final .whl will be in /create_wheel/dist/
160+
# NB: check versions in the `setup.py`
155161
../venv/bin/python3 setup.py bdist_wheel
156162
```
157163

TODO.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# TODO list
22

3-
+ Auto value for `-D INF_ENGINE_RELEASE`
4-
+ Try to submodule things instead of downloading archives of them
5-
+ check tar.gz integrity otherwise
3+
+ Auto value for `-D INF_ENGINE_RELEASE`: https://github.com/openvinotoolkit/openvino/issues/1435
4+

build/dldt/dldt_setup.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ cmake -D CMAKE_BUILD_TYPE=Release \
3939
-D NGRAPH_UNIT_TEST_ENABLE=OFF \
4040
-D NGRAPH_TEST_UTIL_ENABLE=OFF \
4141
-D NGRAPH_ONNX_IMPORT_ENABLE=ON \
42-
-D NGRAPH_JSON_ENABLE=ON \
4342
-D BLAS_LIBRARIES="$BLAS_LIB" \
4443
-D BLAS_INCLUDE_DIRS="$BLAS_INC" \
4544
-D ENABLE_CLDNN=OFF \

build/opencv/opencv_setup.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#
66
# -DINF_ENGINE_RELEASE= should match dldt version
77
# See <https://github.com/opencv/dldt/issues/248#issuecomment-590102331>
8+
# From <https://github.com/opencv/opencv/blob/c8ebe0eb86fca1c2de9de516e27be685eaba3e69/cmake/OpenCVDetectInferenceEngine.cmake#L134>
9+
# "Force IE version, should be in form YYYYAABBCC (e.g. 2020.1.0.2 -> 2020010002)")
810

911
tmp=$(pwd)
1012
ABS_PORTION=${tmp%%"/build/opencv"}
@@ -73,8 +75,8 @@ cmake -D CMAKE_BUILD_TYPE=RELEASE \
7375
-D WITH_NGRAPH=ON \
7476
-D ngraph_DIR=$ABS_PORTION/build/dldt/ngraph \
7577
-D WITH_INF_ENGINE=ON \
76-
-D INF_ENGINE_RELEASE=2020040000 \
78+
-D INF_ENGINE_RELEASE=2021010000 \
7779
-D INF_ENGINE_INCLUDE_DIRS=$ABS_PORTION/dldt/inference-engine/include \
7880
-D INF_ENGINE_LIB_DIRS=$ABS_PORTION/dldt/bin/intel64/Release/lib \
7981
-D CPU_BASELINE=SSE4_2 \
80-
-D CPU_DISPATCH=AVX,AVX2,FP16,AVX512 ../../opencv
82+
-D CPU_DISPATCH=AVX,AVX2,FP16,AVX512 ../../opencv

create_wheel/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ def __len__(self):
1515

1616
setuptools.setup(
1717
name="opencv-python-inference-engine",
18-
version="4.4.0.0",
18+
version="4.5.0.0",
1919
url="https://github.com/banderlog/opencv-python-inference-engine",
2020
maintainer="Kabakov Borys",
2121
license='MIT, BSD, Intel Simplified Software License',
22-
description="Wrapper package for OpenCV 4.4.0 with Inference Engine 2020.4 python bindings",
22+
description="Wrapper package for OpenCV 4.5.0 with Inference Engine 2021.1 python bindings",
2323
long_description=long_description,
2424
long_description_content_type="text/markdown",
2525
ext_modules=EmptyListWithLength(),

dldt

Submodule dldt added at f557dca

dldt/.gitkeep

Whitespace-only changes.

download_all_stuff.sh

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,9 @@ red () {
1717

1818
ROOT_DIR=$(pwd)
1919

20-
green "DOWNLOAD ALL ARCHIVES"
21-
wget -c https://github.com/opencv/opencv/archive/4.4.0.tar.gz -O opencv.tar.gz
22-
wget -c https://github.com/openvinotoolkit/openvino/archive/2020.4.tar.gz -O dldt.tar.gz
23-
wget -c https://github.com/FFmpeg/FFmpeg/archive/n4.3.1.tar.gz -O ffmpeg.tar.gz
24-
wget -c https://github.com/xianyi/OpenBLAS/archive/v0.3.10.tar.gz -O openblas.tar.gz
25-
26-
27-
green "CLEAN LIB DIRS"
28-
rm -drf ./dldt/*
29-
rm -drf ./ffmpeg/*
30-
rm -drf ./opencv/*
31-
rm -drf ./openblas/*
20+
green "RESET GIT SUBMODULES"
21+
# use `git pull && git checkout tags/<tag>` for update
22+
git submodule update --init --recursive
3223

3324
green "CLEAN BUILD DIRS"
3425
find build/dldt/ -mindepth 1 -not -name 'dldt_setup.sh' -delete
@@ -42,32 +33,10 @@ rm -drf create_wheel/build
4233
rm -drf create_wheel/dist
4334
rm -drf create_wheel/*egg-info
4435

45-
green "UNZIP ALL STUFF"
46-
tar -xf opencv.tar.gz --strip-components=1 -C ./opencv/
47-
tar -xf dldt.tar.gz --strip-components=1 -C ./dldt/
48-
tar -xf ffmpeg.tar.gz --strip-components=1 -C ./ffmpeg/
49-
tar -xf openblas.tar.gz --strip-components=1 -C ./openblas/
50-
51-
green "GIT RESET FOR ade"
52-
cd ./dldt/inference-engine/thirdparty/ade
53-
git clone https://github.com/opencv/ade/ ./
54-
git reset --hard cbe2db6
55-
56-
green "GIT RESET FOR mkl-dnn"
57-
cd ../mkl-dnn
58-
git clone https://github.com/openvinotoolkit/oneDNN/ ./
59-
git reset --hard 2706f56
60-
61-
green "GIT RESET FOR IE samples gflags"
62-
cd ../../samples/thirdparty/gflags/
63-
git clone https://github.com/gflags/gflags ./
64-
git reset --hard 46f73f8
65-
66-
6736
green "CREATE VENV"
6837
cd $ROOT_DIR
6938

7039
if [[ ! -d ./venv ]]; then
7140
virtualenv --clear --always-copy -p /usr/bin/python3 ./venv
7241
./venv/bin/pip3 install numpy
73-
fi
42+
fi

ffmpeg

Submodule ffmpeg added at 6b6b9e5

0 commit comments

Comments
 (0)