{"id":347171,"date":"2023-03-23T15:04:46","date_gmt":"2023-03-23T15:04:46","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=347171"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=347171","title":{"rendered":"<span>\u0421\u0431\u043e\u0440\u043a\u0430 OpenCV \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 OpenVINO<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0425\u0430\u0431\u0440\u043e\u0432\u0447\u0430\u043d\u0435. \u042f \u0437\u0430\u043d\u0438\u043c\u0430\u044e \u0434\u043e\u043b\u0436\u043d\u043e\u0441\u0442\u044c Computer Vision Engineer, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0447\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0432 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 Inference Engine. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435:<\/p>\n<ul>\n<li>\n<p>\u0441\u043e\u0431\u0435\u0440\u0451\u043c OpenCV \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 OpenVINO \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 backend&#8217;\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0443\u0437\u043d\u0430\u0435\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 C++ \u0438 Python \u043f\u0440\u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u0440\u0430\u0432\u043d\u044b\u0445.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439, \u0431\u0435\u0437 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0440\u0435\u0447\u0435\u0432\u044b\u0445 \u043e\u0431\u043e\u0440\u043e\u0442\u043e\u0432 \u0438 \u043b\u0438\u0448\u043d\u0435\u0439 \u0432\u043e\u0434\u044b.<\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u0438 \u043c\u043d\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/opencv\/opencv\" rel=\"noopener noreferrer nofollow\">OpenCV: Open Source Computer Vision Library<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/openvinotoolkit\/openvino\" rel=\"noopener noreferrer nofollow\">OpenVINO\u2122 Toolkit<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.opencv.org\/4.x\/d0\/d3d\/tutorial_general_install.html\" rel=\"noopener noreferrer nofollow\">OpenCV installation overview <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.opencv.org\/4.x\/db\/d05\/tutorial_config_reference.html\" rel=\"noopener noreferrer nofollow\">OpenCV configuration options reference<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/opencv\/opencv\/wiki\/Intel%27s-Deep-Learning-Inference-Engine-backend\" rel=\"noopener noreferrer nofollow\">Intel&#8217;s Deep Learning Inference Engine backend<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/opencv\/opencv\/wiki\/BuildOpenCV4OpenVINO\" rel=\"noopener noreferrer nofollow\">BuildOpenCV4OpenVINO<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.opencv.org\/4.x\/db\/df5\/tutorial_linux_gcc_cmake.html\" rel=\"noopener noreferrer nofollow\">Using OpenCV with gcc and CMake<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.opencv.org\/4.x\/d6\/d6d\/tutorial_mat_the_basic_image_container.html\" rel=\"noopener noreferrer nofollow\">Mat &#8212; The Basic Image Container<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.opencv.org\/4.x\/da\/d9d\/tutorial_dnn_yolo.html\" rel=\"noopener noreferrer nofollow\">YOLO DNNs<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b Ubuntu.<\/p>\n<h3>\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/h3>\n<pre><code class=\"bash\">sudo apt remove --purge cmake sudo apt update sudo apt install -y cmake unzip wget<\/code><\/pre>\n<h3>\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/h3>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u043b\u043d\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043f\u043e \u0441\u0431\u043e\u0440\u043a\u0435;<\/p>\n<\/li>\n<li>\n<p><code>bash<\/code>-\u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 <code>person-detection-0200<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f OpenCV DNN \u043d\u0430 \u0421++ \u0438 Python;<\/p>\n<\/li>\n<li>\n<p><code>CMakeLists.txt<\/code> \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0430 C++.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u0448\u0430\u0433\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e\u0442, \u0447\u0442\u043e \u0412\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0435\u0441\u044c \u0432 \u043a\u043e\u0440\u043d\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f.<\/p>\n<pre><code class=\"bash\">git clone git@github.com:DanilZittser\/opencv-python-openvino-backend.git cd opencv-python-openvino-backend<\/code><\/pre>\n<h3>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h3>\n<pre><code class=\"bash\">OPENCV_DIR_NAME=opencv-4.6.0 OPENCV_DIR_PATH=$(pwd)\/${OPENCV_DIR_NAME} OPENVINO_DIR_NAME=openvino-2022.1.1 OPENVINO_DIR_PATH=$(pwd)\/${OPENVINO_DIR_NAME} INSTALL_DIR_PATH=$(pwd)\/install<\/code><\/pre>\n<h3>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 OpenCV \u0438 OpenVINO<\/h3>\n<pre><code class=\"bash\"># opencv-4.6.0 wget https:\/\/github.com\/opencv\/opencv\/archive\/refs\/tags\/4.6.0.zip unzip 4.6.0.zip  # openvino-2022.1.1 wget https:\/\/github.com\/openvinotoolkit\/openvino\/releases\/download\/2022.1.1\/l_openvino_toolkit_ubuntu20_2022.1.1.7030.39aba80957e.tgz tar -xf l_openvino_toolkit_ubuntu20_2022.1.1.7030.39aba80957e.tgz mv l_openvino_toolkit_ubuntu20_2022.1.1.7030.39aba80957e\/ ${OPENVINO_DIR_NAME}<\/code><\/pre>\n<h3>\u0421\u0431\u043e\u0440\u043a\u0430 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h3>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u043c\u0443 \u043f\u0443\u0442\u0438, \u0441\u043c\u043e\u0442\u0440\u0438 \u0444\u043b\u0430\u0433 <code>-DCMAKE_INSTALL_PREFIX<\/code>;<\/p>\n<\/li>\n<li>\n<p>OpenCV \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u0438\u043c\u0438 \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"bash\">mkdir build &amp;&amp; cd build  cmake \\   -DWITH_OPENVINO=ON \\   -DINF_ENGINE_RELEASE=2022010100 \\   -DInferenceEngine_DIR=${OPENVINO_DIR_PATH}\/runtime\/cmake \\   -DOpenVINO_DIR=${OPENVINO_DIR_PATH}\/runtime\/cmake \\   -Dngraph_DIR=${OPENVINO_DIR_PATH}\/runtime\/cmake \\   -DOPENCV_GAPI_WITH_OPENVINO=OFF \\   -DOPENCV_DNN_OPENVINO=ON \\   -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR_PATH} \\   ${OPENCV_DIR_PATH}  make -j$(nproc) &amp;&amp; make install  cd ..<\/code><\/pre>\n<h3>\u0418\u043d\u0444\u0435\u0440\u0435\u043d\u0441 \u043c\u043e\u0434\u0435\u043b\u0438 person-detection-0200.<\/h3>\n<h3>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c:<\/h3>\n<pre><code class=\"bash\">wget https:\/\/storage.openvinotoolkit.org\/repositories\/open_model_zoo\/2022.1\/models_bin\/3\/person-detection-0200\/FP32\/person-detection-0200.xml wget https:\/\/storage.openvinotoolkit.org\/repositories\/open_model_zoo\/2022.1\/models_bin\/3\/person-detection-0200\/FP32\/person-detection-0200.bin<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0434\u0435\u0441\u044c &#8212; <a href=\"https:\/\/github.com\/openvinotoolkit\/open_model_zoo\/tree\/master\/models\/intel\/person-detection-0200\" rel=\"noopener noreferrer nofollow\">person-detection-0200<\/a>.<\/p>\n<p>\u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 <a href=\"https:\/\/docs.openvino.ai\/latest\/omz_tools_downloader.html\" rel=\"noopener noreferrer nofollow\">omz_downloader<\/a> \u0438\u0437 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b OpenVINO.<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 <a href=\"https:\/\/support.hp.com\/rs-en\/document\/c07994653\" rel=\"noopener noreferrer nofollow\">HP OMEN Laptop 15-en1021ur<\/a>.<\/p>\n<h3>Python inference<\/h3>\n<pre><code class=\"bash\"># \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0433\u0434\u0435 \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 OpenCV export PYTHONPATH=${INSTALL_DIR_PATH}\/lib\/python3.8\/site-packages\/cv2\/python-3.8\/:$PYTHONPATH python3 samples\/main.py --xml person-detection-0200.xml --bin person-detection-0200.bin --video person.mp4  >>> Throughput = 259.16 fps<\/code><\/pre>\n<h3>C++ inference<\/h3>\n<pre><code class=\"bash\">export OpenCV_DIR=${INSTALL_DIR_PATH}\/lib\/cmake\/opencv4 # \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 mkdir cmake-build &amp;&amp; cd $_ cmake ..\/ make -j$(nproc) # \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0430 .\/opencv_python_openvino_backend --xml ..\/person-detection-0200.xml --bin ..\/person-detection-0200.bin --video ..\/person.mp4  >>> Throughput = 269.25 fps<\/code><\/pre>\n<p>\u041c\u043e\u0451 \u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0435, C++.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/724276\/\"> https:\/\/habr.com\/ru\/post\/724276\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0425\u0430\u0431\u0440\u043e\u0432\u0447\u0430\u043d\u0435. \u042f \u0437\u0430\u043d\u0438\u043c\u0430\u044e \u0434\u043e\u043b\u0436\u043d\u043e\u0441\u0442\u044c Computer Vision Engineer, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0447\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0432 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 Inference Engine. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435:<\/p>\n<ul>\n<li>\n<p>\u0441\u043e\u0431\u0435\u0440\u0451\u043c OpenCV \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 OpenVINO \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 backend&#8217;\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0443\u0437\u043d\u0430\u0435\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 C++ \u0438 Python \u043f\u0440\u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u0440\u0430\u0432\u043d\u044b\u0445.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439, \u0431\u0435\u0437 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0440\u0435\u0447\u0435\u0432\u044b\u0445 \u043e\u0431\u043e\u0440\u043e\u0442\u043e\u0432 \u0438 \u043b\u0438\u0448\u043d\u0435\u0439 \u0432\u043e\u0434\u044b.<\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u0438 \u043c\u043d\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/opencv\/opencv\" rel=\"noopener noreferrer nofollow\">OpenCV: Open Source Computer Vision Library<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/openvinotoolkit\/openvino\" rel=\"noopener noreferrer nofollow\">OpenVINO\u2122 Toolkit<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.opencv.org\/4.x\/d0\/d3d\/tutorial_general_install.html\" rel=\"noopener noreferrer nofollow\">OpenCV installation overview <\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.opencv.org\/4.x\/db\/d05\/tutorial_config_reference.html\" rel=\"noopener noreferrer nofollow\">OpenCV configuration options reference<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/opencv\/opencv\/wiki\/Intel%27s-Deep-Learning-Inference-Engine-backend\" rel=\"noopener noreferrer nofollow\">Intel&#8217;s Deep Learning Inference Engine backend<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/opencv\/opencv\/wiki\/BuildOpenCV4OpenVINO\" rel=\"noopener noreferrer nofollow\">BuildOpenCV4OpenVINO<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.opencv.org\/4.x\/db\/df5\/tutorial_linux_gcc_cmake.html\" rel=\"noopener noreferrer nofollow\">Using OpenCV with gcc and CMake<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.opencv.org\/4.x\/d6\/d6d\/tutorial_mat_the_basic_image_container.html\" rel=\"noopener noreferrer nofollow\">Mat &#8212; The Basic Image Container<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.opencv.org\/4.x\/da\/d9d\/tutorial_dnn_yolo.html\" rel=\"noopener noreferrer nofollow\">YOLO DNNs<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b Ubuntu.<\/p>\n<h3>\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/h3>\n<pre><code class=\"bash\">sudo apt remove --purge cmake sudo apt update sudo apt install -y cmake unzip wget<\/code><\/pre>\n<h3>\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/h3>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u043b\u043d\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043f\u043e \u0441\u0431\u043e\u0440\u043a\u0435;<\/p>\n<\/li>\n<li>\n<p><code>bash<\/code>-\u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 <code>person-detection-0200<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f OpenCV DNN \u043d\u0430 \u0421++ \u0438 Python;<\/p>\n<\/li>\n<li>\n<p><code>CMakeLists.txt<\/code> \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0430 C++.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u0448\u0430\u0433\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e\u0442, \u0447\u0442\u043e \u0412\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0435\u0441\u044c \u0432 \u043a\u043e\u0440\u043d\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f.<\/p>\n<pre><code class=\"bash\">git clone git@github.com:DanilZittser\/opencv-python-openvino-backend.git cd opencv-python-openvino-backend<\/code><\/pre>\n<h3>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h3>\n<pre><code class=\"bash\">OPENCV_DIR_NAME=opencv-4.6.0 OPENCV_DIR_PATH=$(pwd)\/${OPENCV_DIR_NAME} OPENVINO_DIR_NAME=openvino-2022.1.1 OPENVINO_DIR_PATH=$(pwd)\/${OPENVINO_DIR_NAME} INSTALL_DIR_PATH=$(pwd)\/install<\/code><\/pre>\n<h3>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 OpenCV \u0438 OpenVINO<\/h3>\n<pre><code class=\"bash\"># opencv-4.6.0 wget https:\/\/github.com\/opencv\/opencv\/archive\/refs\/tags\/4.6.0.zip unzip 4.6.0.zip  # openvino-2022.1.1 wget https:\/\/github.com\/openvinotoolkit\/openvino\/releases\/download\/2022.1.1\/l_openvino_toolkit_ubuntu20_2022.1.1.7030.39aba80957e.tgz tar -xf l_openvino_toolkit_ubuntu20_2022.1.1.7030.39aba80957e.tgz mv l_openvino_toolkit_ubuntu20_2022.1.1.7030.39aba80957e\/ ${OPENVINO_DIR_NAME}<\/code><\/pre>\n<h3>\u0421\u0431\u043e\u0440\u043a\u0430 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h3>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u043c\u0443 \u043f\u0443\u0442\u0438, \u0441\u043c\u043e\u0442\u0440\u0438 \u0444\u043b\u0430\u0433 <code>-DCMAKE_INSTALL_PREFIX<\/code>;<\/p>\n<\/li>\n<li>\n<p>OpenCV \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u0438\u043c\u0438 \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"bash\">mkdir build &amp;&amp; cd build  cmake \\   -DWITH_OPENVINO=ON \\   -DINF_ENGINE_RELEASE=2022010100 \\   -DInferenceEngine_DIR=${OPENVINO_DIR_PATH}\/runtime\/cmake \\   -DOpenVINO_DIR=${OPENVINO_DIR_PATH}\/runtime\/cmake \\   -Dngraph_DIR=${OPENVINO_DIR_PATH}\/runtime\/cmake \\   -DOPENCV_GAPI_WITH_OPENVINO=OFF \\   -DOPENCV_DNN_OPENVINO=ON \\   -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR_PATH} \\   ${OPENCV_DIR_PATH}  make -j$(nproc) &amp;&amp; make install  cd ..<\/code><\/pre>\n<h3>\u0418\u043d\u0444\u0435\u0440\u0435\u043d\u0441 \u043c\u043e\u0434\u0435\u043b\u0438 person-detection-0200.<\/h3>\n<h3>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c:<\/h3>\n<pre><code class=\"bash\">wget https:\/\/storage.openvinotoolkit.org\/repositories\/open_model_zoo\/2022.1\/models_bin\/3\/person-detection-0200\/FP32\/person-detection-0200.xml wget https:\/\/storage.openvinotoolkit.org\/repositories\/open_model_zoo\/2022.1\/models_bin\/3\/person-detection-0200\/FP32\/person-detection-0200.bin<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0434\u0435\u0441\u044c &#8212; <a href=\"https:\/\/github.com\/openvinotoolkit\/open_model_zoo\/tree\/master\/models\/intel\/person-detection-0200\" rel=\"noopener noreferrer nofollow\">person-detection-0200<\/a>.<\/p>\n<p>\u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 <a href=\"https:\/\/docs.openvino.ai\/latest\/omz_tools_downloader.html\" rel=\"noopener noreferrer nofollow\">omz_downloader<\/a> \u0438\u0437 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b OpenVINO.<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 <a href=\"https:\/\/support.hp.com\/rs-en\/document\/c07994653\" rel=\"noopener noreferrer nofollow\">HP OMEN Laptop 15-en1021ur<\/a>.<\/p>\n<h3>Python inference<\/h3>\n<pre><code class=\"bash\"># \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0433\u0434\u0435 \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 OpenCV export PYTHONPATH=${INSTALL_DIR_PATH}\/lib\/python3.8\/site-packages\/cv2\/python-3.8\/:$PYTHONPATH python3 samples\/main.py --xml person-detection-0200.xml --bin person-detection-0200.bin --video person.mp4  >>> Throughput = 259.16 fps<\/code><\/pre>\n<h3>C++ inference<\/h3>\n<pre><code class=\"bash\">export OpenCV_DIR=${INSTALL_DIR_PATH}\/lib\/cmake\/opencv4 # \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 mkdir cmake-build &amp;&amp; cd $_ cmake ..\/ make -j$(nproc) # \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0430 .\/opencv_python_openvino_backend --xml ..\/person-detection-0200.xml --bin ..\/person-detection-0200.bin --video ..\/person.mp4  >>> Throughput = 269.25 fps<\/code><\/pre>\n<p>\u041c\u043e\u0451 \u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0435, C++.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/724276\/\"> https:\/\/habr.com\/ru\/post\/724276\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-347171","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/347171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=347171"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/347171\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=347171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=347171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=347171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}