Use modern OpenVINO package interface#21452
Conversation
alalek
left a comment
There was a problem hiding this comment.
Need to try to preserve compatibility of legacy user options.
|
@alalek , do you mean compatibility of |
modules/dnn/CMakeLists.txt
Outdated
| message(STATUS "DNN: Enabling OpenVINO Toolkit support") | ||
| math(EXPR OV_VER "${OpenVINO_VERSION_MAJOR} * 1000000 + ${OpenVINO_VERSION_MINOR} * 10000 + ${OpenVINO_VERSION_PATCH} * 100") | ||
| # TODO: rename definitions | ||
| add_definitions("-DHAVE_DNN_NGRAPH" "-DHAVE_INF_ENGINE=1" "-DINF_ENGINE_RELEASE=${OV_VER}") |
There was a problem hiding this comment.
G-API also uses INF_ENGINE_RELEASE variable.
Could we reuse ocv_add_external_target() approach with added definitions?
There was a problem hiding this comment.
Done! I've added ocv.3rdparty.openvino interface target with dependencies on IE and ngraph or whole OpenVINO. It seem to be working with OpenVINO@master and 2021.4 package.
Also removed OPENCV_DNN_IE_NN_BUILDER_2019 option from cmake. I did not remove it from the code to avoid conflicts.
Apparently, -DWITH_INF_ENGINE=ON -DWITH_NGRAPH=OFF does not work on current 4.x branch (with 2021.4), I didn't try to fix it. Looks like nobody uses such configuration and future OpenVINO versions will not have separation between these components.
|
Rebased to latest 4.x along with changes from https://github.com/alalek/opencv/tree/pr21452_r |
|
Rebased to resolve modules/gapi/CMakeLists.txt conflict |
WITH_OPENVINO,OPENCV_GAPI_WITH_OPENVINO, old options are deprecatedNotes:
INF_ENGINE_RELEASE)Validation: