You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
I'll do more straightforward and well-documented examples of usage in the foreseeable future. But for now, please see the tests folder.
17
+
Please see the `examples.ipynb`in the `tests` folder.
18
18
19
19
You will need to preprocess data as a model requires and decode the output. A description of the decoding *should* be in the model documentation with examples in open-vino documentation, however, in some cases, the original article may be the only information source. Some models are very simple to encode/decode, others are tough (e.g., PixelLink in tests).
20
20
21
21
22
-
## Why
22
+
## Downloading intel models
23
+
24
+
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))
25
+
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/)
27
+
28
+
29
+
## Description
30
+
31
+
32
+
### Why
23
33
24
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).
25
35
Well-known [opencv-python](https://github.com/skvark/opencv-python) can't do this.
26
36
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).
27
37
28
38
29
-
## Description
30
-
31
39
### Limitations
32
40
33
41
+ Package comes without contrib modules.
@@ -62,21 +70,16 @@ For additional info read `cv2.getBuildInformation()` output.
62
70
63
71
### Versioning
64
72
65
-
The first 3 letters are the version of OpenCV, the last one -- package version. E.g, `4.1.0.2` -- 2nd version of based on 4.1.0 OpenCV package. Package versions are not continuously numbered -- each new OpenCV version starts its own numbering.
66
-
67
-
68
-
## Downloading intel models
69
-
70
-
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))
71
-
72
-
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/)
73
+
The first 3 letters are the version of OpenCV, underscore, then inference engine (dldt/openvino) version, underscore, package version.
74
+
E.g, `4.5.1_2120.2_0` -- first version of based on 4.5.1 OpenCV package with 2021.2 inference engine module.
75
+
Package versions are not continuously numbered -- each new OpenCV-dldt version pair starts its own numbering.
73
76
74
77
75
78
## Compiling from source
76
79
77
80
You will need ~7GB RAM and ~10GB disk space
78
81
79
-
I am using Ubuntu 18.04 [multipass](https://multipass.run/) instance: `multipass launch -c 6 -d 10G -m 7G`.
82
+
I am using Ubuntu 18.04 [multipass](https://multipass.run/) instance: `multipass launch -c 6 -d 10G -m 7G 18.04`.
80
83
81
84
### Requirements
82
85
@@ -96,7 +99,7 @@ From [opencv](https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html)
96
99
+`nasm` (for ffmpeg)
97
100
98
101
```bash
99
-
# We need newer `cmake` for dldt (commands from <https://apt.kitware.com/>)
102
+
# We need newer `cmake` for dldt (fastest way I know)
100
103
sudo apt remove --purge cmake
101
104
hash -r
102
105
sudo snap install cmake --classic
@@ -186,15 +189,14 @@ Make next changes in `opencv-python-inference-engine/build/opencv/opencv_setup.s
186
189
187
190
Exporting `PKG_CONFIG_PATH` for `ffmpeg` somehow messes with default values.
188
191
189
-
#### IPP
192
+
It will add ~16MB to the package.
193
+
194
+
#### Integrated Performance Primitives
190
195
191
196
Just set `-D WITH_IPP=ON` in `opencv_setup.sh`.
192
197
193
198
It will give +30MB to the final `cv2.so` size. And it will boost _some_ opencv functions.
(Image from [Learning OpenCV 3 by Gary Bradski, Adrian Kaehler](https://www.oreilly.com/library/view/learning-opencv-3/9781491937983/ch01.html))
197
-
198
200
[Official Intel's IPP benchmarks](https://software.intel.com/en-us/ipp/benchmarks) (may ask for registration)
199
201
200
202
#### MKL
@@ -205,15 +207,6 @@ OpenVino comes with 30MB `libmkl_tiny_tbb.so`, but [you will not be able to comp
205
207
206
208
Our opensource MKL-DNN experiment will end with 125MB `libmklml_gnu.so` and inference speed compatible with 5MB openblas ([details](https://github.com/banderlog/opencv-python-inference-engine/issues/5)).
207
209
208
-
#### OpenBLAS
209
-
210
-
Please refer here for details: https://github.com/xianyi/OpenBLAS/issues/2528
+[OpenBLAS User Manual](https://github.com/xianyi/OpenBLAS/wiki/User-Manual)
214
-
215
-
If you compile it with `make FC=gfortran`, you'll need to put `libgfortran.so.4` and `libquadmath.so.0` to wheel and set them rpath via `patchelf --set-rpath \$ORIGIN *.so`
216
-
217
210
218
211
#### CUDA
219
212
@@ -223,16 +216,6 @@ I did not try it. But it cannot be universal, it will only work with the certain
223
216
+[Use OpenCV’s ‘dnn’ module with NVIDIA GPUs, CUDA, and cuDNN](https://www.pyimagesearch.com/2020/02/03/how-to-use-opencvs-dnn-module-with-nvidia-gpus-cuda-and-cudnn/)
224
217
225
218
226
-
#### Build `ffmpeg` with `tbb`
227
-
228
-
Both `dldt` and `opencv` are compiled with `tbb` support, and `ffmpeg` compiled without it -- this does not feel right.
229
-
There is some unproved solution for how to compile `ffmpeg` with `tbb` support: <https://stackoverflow.com/questions/6049798/ffmpeg-mt-and-tbb>
230
-
231
-
232
219
#### OpenMP
233
220
234
221
It is possible to compile OpenBLAS, dldt and OpenCV with OpenMP. I am not sure that the result would be better than now, but who knows.
235
-
236
-
#### Use opencv for NLP
237
-
238
-
Presumably, you could also use speech2text model now -- [source](https://docs.openvinotoolkit.org/latest/_inference_engine_samples_speech_libs_and_demos_Speech_libs_and_demos.html)
0 commit comments