diff options
author | Yogesh Tyagi <yogesh.tyagi@intel.com> | 2024-06-27 12:14:27 +0530 |
---|---|---|
committer | Anuj Mittal <anuj.mittal@intel.com> | 2024-07-12 16:40:57 +0800 |
commit | e97386254712047f27f5554da6470fe3fb65d07a (patch) | |
tree | d6e49969da310c1ac1edfce0451099a7aa91281c | |
parent | ea0a7de92f983fde57ae64d642fb7b534627cd82 (diff) | |
download | meta-intel-e97386254712047f27f5554da6470fe3fb65d07a.tar.gz |
openvino-inference-engine : Remove openvino related recipes and tests
* Remove all openvino related recipes, tests and other data from meta-intel
layer as a new layer (meta-oepnvino) specific to openvino has been created.
* Update openvino documentation
meta-openvino layer URL:
https://github.com/intel/meta-openvino
Signed-off-by: Yogesh Tyagi <yogesh.tyagi@intel.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
16 files changed, 3 insertions, 822 deletions
diff --git a/conf/include/maintainers.inc b/conf/include/maintainers.inc index 3403b6b6..b6ee370f 100644 --- a/conf/include/maintainers.inc +++ b/conf/include/maintainers.inc | |||
@@ -40,10 +40,7 @@ RECIPE_MAINTAINER:pn-onednn = "Naveen Saini <naveen.kumar.saini@intel.com>" | |||
40 | RECIPE_MAINTAINER:pn-onedpl = "Naveen Saini <naveen.kumar.saini@intel.com>" | 40 | RECIPE_MAINTAINER:pn-onedpl = "Naveen Saini <naveen.kumar.saini@intel.com>" |
41 | RECIPE_MAINTAINER:pn-onevpl = "Naveen Saini <naveen.kumar.saini@intel.com>" | 41 | RECIPE_MAINTAINER:pn-onevpl = "Naveen Saini <naveen.kumar.saini@intel.com>" |
42 | RECIPE_MAINTAINER:pn-onevpl-intel-gpu = "Yew Chang Ching <chang.ching.yew@intel.com>" | 42 | RECIPE_MAINTAINER:pn-onevpl-intel-gpu = "Yew Chang Ching <chang.ching.yew@intel.com>" |
43 | RECIPE_MAINTAINER:pn-open-model-zoo = "Anuj Mittal <anuj.mittal@intel.com>" | ||
44 | RECIPE_MAINTAINER:pn-opencl-clang = "Naveen Saini <naveen.kumar.saini@intel.com>" | 43 | RECIPE_MAINTAINER:pn-opencl-clang = "Naveen Saini <naveen.kumar.saini@intel.com>" |
45 | RECIPE_MAINTAINER:pn-openvino-inference-engine = "Anuj Mittal <anuj.mittal@intel.com>" | ||
46 | RECIPE_MAINTAINER:pn-openvino-model-optimizer = "Anuj Mittal <anuj.mittal@intel.com>" | ||
47 | RECIPE_MAINTAINER:pn-openvkl = "Naveen Saini <naveen.kumar.saini@intel.com>" | 44 | RECIPE_MAINTAINER:pn-openvkl = "Naveen Saini <naveen.kumar.saini@intel.com>" |
48 | RECIPE_MAINTAINER:pn-ospray = "Naveen Saini <naveen.kumar.saini@intel.com>" | 45 | RECIPE_MAINTAINER:pn-ospray = "Naveen Saini <naveen.kumar.saini@intel.com>" |
49 | RECIPE_MAINTAINER:pn-rkcommon = "Naveen Saini <naveen.kumar.saini@intel.com>" | 46 | RECIPE_MAINTAINER:pn-rkcommon = "Naveen Saini <naveen.kumar.saini@intel.com>" |
diff --git a/documentation/openvino.md b/documentation/openvino.md index 50dc680d..9794b928 100644 --- a/documentation/openvino.md +++ b/documentation/openvino.md | |||
@@ -11,6 +11,7 @@ Follow the [Yocto Project official documentation](https://docs.yoctoproject.org/ | |||
11 | git clone https://git.yoctoproject.org/git/poky | 11 | git clone https://git.yoctoproject.org/git/poky |
12 | git clone https://github.com/openembedded/meta-openembedded | 12 | git clone https://github.com/openembedded/meta-openembedded |
13 | git clone https://git.yoctoproject.org/git/meta-intel | 13 | git clone https://git.yoctoproject.org/git/meta-intel |
14 | git clone https://github.com/intel/meta-openvino | ||
14 | ``` | 15 | ``` |
15 | 16 | ||
16 | 17 | ||
@@ -30,6 +31,7 @@ Follow the [Yocto Project official documentation](https://docs.yoctoproject.org/ | |||
30 | bitbake-layers add-layer ../meta-openembedded/meta-oe | 31 | bitbake-layers add-layer ../meta-openembedded/meta-oe |
31 | bitbake-layers add-layer ../meta-openembedded/meta-python | 32 | bitbake-layers add-layer ../meta-openembedded/meta-python |
32 | bitbake-layers add-layer ../meta-intel | 33 | bitbake-layers add-layer ../meta-intel |
34 | bitbake-layers add-layer ../meta-openvino | ||
33 | 35 | ||
34 | ``` | 36 | ``` |
35 | 37 | ||
@@ -54,9 +56,6 @@ Follow the [Yocto Project official documentation](https://docs.yoctoproject.org/ | |||
54 | # Include OpenVINO Python API package in the target image. | 56 | # Include OpenVINO Python API package in the target image. |
55 | CORE_IMAGE_EXTRA_INSTALL:append = " openvino-inference-engine-python3" | 57 | CORE_IMAGE_EXTRA_INSTALL:append = " openvino-inference-engine-python3" |
56 | 58 | ||
57 | # Include model conversion API in the target image. | ||
58 | CORE_IMAGE_EXTRA_INSTALL:append = " openvino-model-optimizer" | ||
59 | |||
60 | ``` | 59 | ``` |
61 | 60 | ||
62 | ## Step 2: Build a Yocto Image with OpenVINO Packages | 61 | ## Step 2: Build a Yocto Image with OpenVINO Packages |
@@ -88,8 +87,6 @@ If the image build is successful, it will return the list of packages as below: | |||
88 | openvino-inference-engine-python3 | 87 | openvino-inference-engine-python3 |
89 | openvino-inference-engine-samples | 88 | openvino-inference-engine-samples |
90 | openvino-inference-engine-src | 89 | openvino-inference-engine-src |
91 | openvino-model-optimizer | 90 | openvino-inference-engine-doc |
92 | openvino-model-optimizer-dbg | ||
93 | openvino-model-optimizer-dev | ||
94 | 91 | ||
95 | ``` | 92 | ``` |
diff --git a/dynamic-layers/meta-python/recipes-opencv/dldt/openvino-model-optimizer_2024.1.0.bb b/dynamic-layers/meta-python/recipes-opencv/dldt/openvino-model-optimizer_2024.1.0.bb deleted file mode 100644 index de765d6c..00000000 --- a/dynamic-layers/meta-python/recipes-opencv/dldt/openvino-model-optimizer_2024.1.0.bb +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | SUMMARY = "OpenVINO Model Optimzer" | ||
2 | DESCRIPTION = "Model Optimizer is a cross-platform command-line tool that \ | ||
3 | facilitates the transition between the training and deployment \ | ||
4 | environment, performs static model analysis, and adjusts deep \ | ||
5 | learning models for optimal execution on end-point target devices." | ||
6 | HOMEPAGE = "https://01.org/openvinotoolkit" | ||
7 | |||
8 | SRC_URI = "git://github.com/openvinotoolkit/openvino.git;protocol=https;branch=releases/2024/1;lfs=0 \ | ||
9 | " | ||
10 | SRCREV = "f4afc983258bcb2592d999ed6700043fdb58ad78" | ||
11 | |||
12 | LICENSE = "Apache-2.0" | ||
13 | LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" | ||
14 | |||
15 | CVE_PRODUCT = "intel:openvino" | ||
16 | S = "${WORKDIR}/git" | ||
17 | |||
18 | inherit setuptools3 | ||
19 | |||
20 | SETUPTOOLS_SETUP_PATH = "${WORKDIR}/git/tools/mo" | ||
21 | |||
22 | RDEPENDS:${PN} += " \ | ||
23 | python3-defusedxml \ | ||
24 | python3-fastjsonschema \ | ||
25 | python3-networkx \ | ||
26 | python3-numpy \ | ||
27 | python3-protobuf \ | ||
28 | python3-requests \ | ||
29 | python3-urllib3 \ | ||
30 | bash \ | ||
31 | " | ||
32 | |||
33 | UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+\.\d+\.\d+))$" | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-cmake-yocto-specific-tweaks-to-the-build-process.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-cmake-yocto-specific-tweaks-to-the-build-process.patch deleted file mode 100644 index 7f5b46c6..00000000 --- a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-cmake-yocto-specific-tweaks-to-the-build-process.patch +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | From e4edbdae9a2dbfec6fd0706bdfff8abdfe3363fc Mon Sep 17 00:00:00 2001 | ||
2 | From: Anuj Mittal <anuj.mittal@intel.com> | ||
3 | Date: Wed, 29 Nov 2023 12:42:57 +0530 | ||
4 | Subject: [PATCH] cmake: yocto specific tweaks to the build process | ||
5 | |||
6 | * Dont try to detect glibc version as that doesn't work when cross compiling. | ||
7 | * Dont try to detect CXX11_ABI | ||
8 | * Install sample binaries as well. | ||
9 | * Dont try to write triggers for CPack. We package ourselves. | ||
10 | * Fix the installation path for Python modules when baselib = lib64. | ||
11 | |||
12 | Upstream-Status: Inappropriate | ||
13 | |||
14 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
15 | --- | ||
16 | cmake/developer_package/packaging/rpm/rpm.cmake | 2 +- | ||
17 | cmake/developer_package/target_flags.cmake | 4 ++-- | ||
18 | samples/cpp/CMakeLists.txt | 6 +++--- | ||
19 | src/bindings/python/CMakeLists.txt | 2 +- | ||
20 | 4 files changed, 7 insertions(+), 7 deletions(-) | ||
21 | |||
22 | diff --git a/cmake/developer_package/packaging/rpm/rpm.cmake b/cmake/developer_package/packaging/rpm/rpm.cmake | ||
23 | index 99f11730983..1a1f61fcd3d 100644 | ||
24 | --- a/cmake/developer_package/packaging/rpm/rpm.cmake | ||
25 | +++ b/cmake/developer_package/packaging/rpm/rpm.cmake | ||
26 | @@ -156,7 +156,7 @@ ov_rpm_specific_settings() | ||
27 | # needed to add triggers for packages with libraries | ||
28 | set(def_triggers "${OpenVINO_BINARY_DIR}/_CPack_Packages/triggers") | ||
29 | set(triggers_content "# /bin/sh -p\n/sbin/ldconfig\n") | ||
30 | -file(WRITE "${def_triggers}" "${triggers_content}") | ||
31 | +#file(WRITE "${def_triggers}" "${triggers_content}") | ||
32 | |||
33 | # | ||
34 | # Functions helpful for packaging your modules with RPM cpack | ||
35 | diff --git a/cmake/developer_package/target_flags.cmake b/cmake/developer_package/target_flags.cmake | ||
36 | index d047a1aebd9..4e8ca68c60f 100644 | ||
37 | --- a/cmake/developer_package/target_flags.cmake | ||
38 | +++ b/cmake/developer_package/target_flags.cmake | ||
39 | @@ -149,7 +149,7 @@ function(ov_glibc_version) | ||
40 | endif() | ||
41 | endfunction() | ||
42 | |||
43 | -ov_glibc_version() | ||
44 | +#ov_glibc_version() | ||
45 | |||
46 | # | ||
47 | # Detects default value for _GLIBCXX_USE_CXX11_ABI for current compiler | ||
48 | @@ -160,4 +160,4 @@ macro(ov_get_glibcxx_use_cxx11_abi) | ||
49 | endif() | ||
50 | endmacro() | ||
51 | |||
52 | -ov_get_glibcxx_use_cxx11_abi() | ||
53 | +#ov_get_glibcxx_use_cxx11_abi() | ||
54 | diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txt | ||
55 | index 4d33bff944e..3e7f1458578 100644 | ||
56 | --- a/samples/cpp/CMakeLists.txt | ||
57 | +++ b/samples/cpp/CMakeLists.txt | ||
58 | @@ -206,9 +206,9 @@ macro(ov_add_sample) | ||
59 | target_link_libraries(${SAMPLE_NAME} PRIVATE ${ov_link_libraries} Threads::Threads ${SAMPLE_DEPENDENCIES}) | ||
60 | |||
61 | install(TARGETS ${SAMPLE_NAME} | ||
62 | - RUNTIME DESTINATION samples_bin/ | ||
63 | - COMPONENT samples_bin | ||
64 | - EXCLUDE_FROM_ALL) | ||
65 | + DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
66 | + COMPONENT samples_bin) | ||
67 | + | ||
68 | |||
69 | # create global target with all samples / demo apps | ||
70 | if(NOT TARGET ov_samples) | ||
71 | diff --git a/src/bindings/python/CMakeLists.txt b/src/bindings/python/CMakeLists.txt | ||
72 | index 6cf43ec3fed..d539b9d003f 100644 | ||
73 | --- a/src/bindings/python/CMakeLists.txt | ||
74 | +++ b/src/bindings/python/CMakeLists.txt | ||
75 | @@ -320,7 +320,7 @@ if(ENABLE_PYTHON_PACKAGING) | ||
76 | # install OpenVINO Python API | ||
77 | |||
78 | set(python_package_prefix "${CMAKE_CURRENT_BINARY_DIR}/install_${pyversion}") | ||
79 | - set(install_lib "${python_package_prefix}/lib/${python_versioned_folder}/${ov_site_packages}") | ||
80 | + set(install_lib "${python_package_prefix}/${CMAKE_INSTALL_LIBDIR}/${python_versioned_folder}/${ov_site_packages}") | ||
81 | set(openvino_meta_info_subdir "openvino-${OpenVINO_VERSION}-py${python_xy}.egg-info") | ||
82 | set(openvino_meta_info_file "${install_lib}/${openvino_meta_info_subdir}/PKG-INFO") | ||
83 | |||
84 | -- | ||
85 | 2.34.1 | ||
86 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0002-cmake-Fix-overloaded-virtual-error.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0002-cmake-Fix-overloaded-virtual-error.patch deleted file mode 100644 index 8a1464d5..00000000 --- a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0002-cmake-Fix-overloaded-virtual-error.patch +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | From 4a909a03b6dd336e7ea76e3f44d7cfb5d7e44798 Mon Sep 17 00:00:00 2001 | ||
2 | From: Anuj Mittal <anuj.mittal@intel.com> | ||
3 | Date: Wed, 29 Nov 2023 12:49:35 +0530 | ||
4 | Subject: [PATCH 2/3] cmake: Fix overloaded-virtual error | ||
5 | |||
6 | * Remove -Werror for: | ||
7 | |git/src/plugins/intel_gpu/src/kernel_selector/jitter.h:129:28: error: 'virtual kernel_selector::JitDefinitions kernel_selector::JitConstant::GetDefinitions() const' was hidden [-Werror=overloaded-virtual=] | ||
8 | | 129 | virtual JitDefinitions GetDefinitions() const = 0; | ||
9 | | | | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | |||
13 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
14 | --- | ||
15 | src/plugins/intel_gpu/CMakeLists.txt | 2 +- | ||
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
17 | |||
18 | diff --git a/src/plugins/intel_gpu/CMakeLists.txt b/src/plugins/intel_gpu/CMakeLists.txt | ||
19 | index 2f3d9127dde..2fd4f5c1b3c 100644 | ||
20 | --- a/src/plugins/intel_gpu/CMakeLists.txt | ||
21 | +++ b/src/plugins/intel_gpu/CMakeLists.txt | ||
22 | @@ -47,7 +47,7 @@ add_subdirectory(thirdparty) | ||
23 | include(thirdparty/cmake/rapidjson.cmake) | ||
24 | |||
25 | if(CMAKE_COMPILER_IS_GNUCXX) | ||
26 | - ov_add_compiler_flags(-Werror) | ||
27 | + #ov_add_compiler_flags(-Werror) | ||
28 | endif() | ||
29 | |||
30 | add_subdirectory(src/runtime) | ||
31 | -- | ||
32 | 2.34.1 | ||
33 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0003-protobuf-allow-target-protoc-to-be-built.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0003-protobuf-allow-target-protoc-to-be-built.patch deleted file mode 100644 index bbdeaa2a..00000000 --- a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0003-protobuf-allow-target-protoc-to-be-built.patch +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | From 450d94b475460d1af32b207d0ced495794863f0d Mon Sep 17 00:00:00 2001 | ||
2 | From: Anuj Mittal <anuj.mittal@intel.com> | ||
3 | Date: Wed, 29 Nov 2023 12:55:19 +0530 | ||
4 | Subject: [PATCH 3/3] protobuf: allow target protoc to be built | ||
5 | |||
6 | We can run target binaries using a qemu wrapper so allow these to be | ||
7 | built and run. | ||
8 | |||
9 | Upstream-Status: Inappropriate | ||
10 | |||
11 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
12 | --- | ||
13 | cmake/developer_package/frontends/frontends.cmake | 2 +- | ||
14 | thirdparty/protobuf/CMakeLists.txt | 2 +- | ||
15 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmake | ||
18 | index f3b5520d6d2..7579f638c5a 100644 | ||
19 | --- a/cmake/developer_package/frontends/frontends.cmake | ||
20 | +++ b/cmake/developer_package/frontends/frontends.cmake | ||
21 | @@ -163,7 +163,7 @@ macro(ov_add_frontend) | ||
22 | set(OUTPUT_PB_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${relative_path}/${FILE_WE}.pb.h) | ||
23 | add_custom_command( | ||
24 | OUTPUT "${OUTPUT_PB_SRC}" "${OUTPUT_PB_HEADER}" | ||
25 | - COMMAND ${PROTOC_EXECUTABLE} ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} -I ${protofiles_root_dir} ${proto_file} | ||
26 | + COMMAND protoc ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} -I ${protofiles_root_dir} ${proto_file} | ||
27 | DEPENDS ${PROTOC_DEPENDENCY} ${proto_file} | ||
28 | COMMENT "Running C++ protocol buffer compiler (${PROTOC_EXECUTABLE}) on ${proto_file_relative}" | ||
29 | VERBATIM | ||
30 | diff --git a/thirdparty/protobuf/CMakeLists.txt b/thirdparty/protobuf/CMakeLists.txt | ||
31 | index 15f32601f23..36853caf7dc 100644 | ||
32 | --- a/thirdparty/protobuf/CMakeLists.txt | ||
33 | +++ b/thirdparty/protobuf/CMakeLists.txt | ||
34 | @@ -31,7 +31,7 @@ unset(HAVE_ZLIB CACHE) | ||
35 | if(CMAKE_CROSSCOMPILING OR | ||
36 | (APPLE AND (HOST_X86_64 AND AARCH64)) OR | ||
37 | (MSVC AND (HOST_X86_64 AND (AARCH64 OR ARM)))) | ||
38 | - set(protobuf_BUILD_PROTOC_BINARIES OFF CACHE BOOL "Build protoc binaries" FORCE) | ||
39 | + set(protobuf_BUILD_PROTOC_BINARIES ON CACHE BOOL "Build protoc binaries" FORCE) | ||
40 | else() | ||
41 | set(protobuf_BUILD_PROTOC_BINARIES ON CACHE BOOL "Build protoc binaries" FORCE) | ||
42 | endif() | ||
43 | -- | ||
44 | 2.34.1 | ||
45 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo/0001-use-oe-gflags.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo/0001-use-oe-gflags.patch deleted file mode 100644 index 816a98a3..00000000 --- a/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo/0001-use-oe-gflags.patch +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | From 804b08023b3f8e72b8e3eb09e464d6775c11d966 Mon Sep 17 00:00:00 2001 | ||
2 | From: Naveen Saini <naveen.kumar.saini@intel.com> | ||
3 | Date: Fri, 21 Oct 2022 11:38:23 +0800 | ||
4 | Subject: [PATCH] demos: use gflags from meta-oe | ||
5 | |||
6 | Upstream-Status: Inappropriate | ||
7 | |||
8 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
9 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
10 | |||
11 | --- | ||
12 | demos/CMakeLists.txt | 2 +- | ||
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt | ||
16 | index 51767051c..fb7e3d22f 100644 | ||
17 | --- a/demos/CMakeLists.txt | ||
18 | +++ b/demos/CMakeLists.txt | ||
19 | @@ -141,7 +141,7 @@ endmacro() | ||
20 | find_package(OpenCV REQUIRED COMPONENTS core highgui videoio imgproc imgcodecs) | ||
21 | find_package(OpenVINO REQUIRED COMPONENTS Runtime) | ||
22 | |||
23 | -add_subdirectory(thirdparty/gflags) | ||
24 | +#add_subdirectory(thirdparty/gflags) | ||
25 | add_subdirectory(common/cpp) | ||
26 | |||
27 | find_package(OpenCV QUIET COMPONENTS gapi) | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2024.1.0.bb b/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2024.1.0.bb deleted file mode 100644 index a9422e70..00000000 --- a/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2024.1.0.bb +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | SUMMARY = "OpenVINO(TM) Toolkit - Open Model Zoo repository" | ||
2 | HOMEPAGE = "https://github.com/opencv/open_model_zoo" | ||
3 | DESCRIPTION = "This repository includes optimized deep learning \ | ||
4 | models and a set of demos to expedite development of high-performance \ | ||
5 | deep learning inference applications." | ||
6 | |||
7 | SRC_URI = "git://github.com/opencv/open_model_zoo.git;protocol=https;branch=master \ | ||
8 | file://0001-use-oe-gflags.patch \ | ||
9 | " | ||
10 | |||
11 | SRCREV = "cf5141dad2a4f24e1c5d5b9d43219ed804c48bbf" | ||
12 | |||
13 | LICENSE = "Apache-2.0" | ||
14 | LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \ | ||
15 | " | ||
16 | |||
17 | inherit cmake | ||
18 | |||
19 | S = "${WORKDIR}/git" | ||
20 | OECMAKE_SOURCEPATH = "${S}/demos" | ||
21 | |||
22 | DEPENDS += "openvino-inference-engine opencv gflags" | ||
23 | |||
24 | RDEPENDS:${PN} += " \ | ||
25 | python3-decorator \ | ||
26 | python3-defusedxml \ | ||
27 | python3-networkx \ | ||
28 | python3-protobuf \ | ||
29 | python3-requests \ | ||
30 | python3-pyyaml \ | ||
31 | python3-numpy \ | ||
32 | bash \ | ||
33 | " | ||
34 | |||
35 | COMPATIBLE_HOST = '(x86_64).*-linux' | ||
36 | COMPATIBLE_HOST:libc-musl = "null" | ||
37 | |||
38 | EXTRA_OECMAKE += " \ | ||
39 | -DENABLE_SAMPLES=ON \ | ||
40 | " | ||
41 | |||
42 | do_install(){ | ||
43 | install -d ${D}${libdir} | ||
44 | install -d ${D}${bindir} | ||
45 | install -d ${D}${datadir}/openvino/open-model-zoo/tools | ||
46 | install -d ${D}${datadir}/openvino/open-model-zoo/demos | ||
47 | cp -rf ${B}/intel64/Release/*.a ${D}${libdir} | ||
48 | cp -rf ${B}/intel64/Release/*_demo* ${D}${bindir} | ||
49 | cp -rf ${S}/models ${D}${datadir}/openvino/open-model-zoo | ||
50 | cp -rf ${S}/demos ${D}${datadir}/openvino/open-model-zoo | ||
51 | cp -rf ${S}/tools/model_tools ${D}${datadir}/openvino/open-model-zoo/tools | ||
52 | } | ||
53 | |||
54 | FILES:${PN} += "${datadir}/openvino" | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2024.1.0.bb b/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2024.1.0.bb deleted file mode 100644 index 675d9920..00000000 --- a/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2024.1.0.bb +++ /dev/null | |||
@@ -1,146 +0,0 @@ | |||
1 | SUMMARY = "OpenVINO(TM) Toolkit - Deep Learning Deployment Toolkit" | ||
2 | HOMEPAGE = "https://github.com/opencv/dldt" | ||
3 | DESCRIPTION = "This toolkit allows developers to deploy pre-trained \ | ||
4 | deep learning models through a high-level C++ Inference Engine API \ | ||
5 | integrated with application logic." | ||
6 | |||
7 | SRC_URI = "git://github.com/openvinotoolkit/openvino.git;protocol=https;name=openvino;branch=releases/2024/1;lfs=0 \ | ||
8 | git://github.com/openvinotoolkit/oneDNN.git;protocol=https;destsuffix=git/src/plugins/intel_cpu/thirdparty/onednn;name=mkl;nobranch=1 \ | ||
9 | git://github.com/oneapi-src/oneDNN.git;protocol=https;destsuffix=git/src/plugins/intel_gpu/thirdparty/onednn_gpu;name=onednn;nobranch=1 \ | ||
10 | git://github.com/herumi/xbyak.git;protocol=https;destsuffix=git/thirdparty/xbyak;name=xbyak;branch=master \ | ||
11 | git://github.com/nlohmann/json.git;protocol=https;destsuffix=git/thirdparty/json/nlohmann_json;name=json;branch=develop \ | ||
12 | git://github.com/opencv/ade.git;protocol=https;destsuffix=git/thirdparty/ade;name=ade;nobranch=1 \ | ||
13 | git://github.com/protocolbuffers/protobuf.git;protocol=https;destsuffix=git/thirdparty/protobuf/protobuf;name=protobuf;branch=3.20.x \ | ||
14 | git://github.com/gflags/gflags.git;protocol=https;destsuffix=git/thirdparty/gflags/gflags;name=gflags;nobranch=1 \ | ||
15 | git://github.com/madler/zlib.git;protocol=https;destsuffix=git/thirdparty/zlib/zlib;name=zlib;nobranch=1 \ | ||
16 | git://github.com/openvinotoolkit/mlas.git;protocol=https;destsuffix=git/src/plugins/intel_cpu/thirdparty/mlas;name=mlas;nobranch=1 \ | ||
17 | git://github.com/nodejs/node-api-headers.git;protocol=https;destsuffix=git/node-api-headers-src;name=node-api-headers;nobranch=1 \ | ||
18 | git://github.com/nodejs/node-addon-api.git;protocol=https;destsuffix=git/node-addon-api-src;name=node-addon-api;nobranch=1 \ | ||
19 | git://github.com/openvinotoolkit/telemetry.git;protocol=https;destsuffix=git/thirdparty/telemetry;name=telemetry;nobranch=1;lfs=0 \ | ||
20 | file://0001-cmake-yocto-specific-tweaks-to-the-build-process.patch \ | ||
21 | file://0002-cmake-Fix-overloaded-virtual-error.patch \ | ||
22 | file://0003-protobuf-allow-target-protoc-to-be-built.patch \ | ||
23 | " | ||
24 | |||
25 | SRCREV_openvino = "f4afc983258bcb2592d999ed6700043fdb58ad78" | ||
26 | SRCREV_mkl = "26633ae49edd4353a29b7170d9fcef6b2d79f4b3" | ||
27 | SRCREV_onednn = "4e6ff043c439652fcf6c400ac4e0c81bbac7c71c" | ||
28 | SRCREV_xbyak = "740dff2e866f3ae1a70dd42d6e8836847ed95cc2" | ||
29 | SRCREV_json = "9cca280a4d0ccf0c08f47a99aa71d1b0e52f8d03" | ||
30 | SRCREV_ade = "0e8a2ccdd34f29dba55894f5f3c5179809888b9e" | ||
31 | SRCREV_protobuf = "fe271ab76f2ad2b2b28c10443865d2af21e27e0e" | ||
32 | SRCREV_gflags = "e171aa2d15ed9eb17054558e0b3a6a413bb01067" | ||
33 | SRCREV_zlib = "09155eaa2f9270dc4ed1fa13e2b4b2613e6e4851" | ||
34 | SRCREV_mlas = "d1bc25ec4660cddd87804fcf03b2411b5dfb2e94" | ||
35 | SRCREV_node-api-headers = "186e04b5e40e54d7fd1655bc67081cc483f12488" | ||
36 | SRCREV_node-addon-api = "39a25bf27788ff7a7ea5c64978c4dcd1e7b9d80d" | ||
37 | SRCREV_telemetry = "58e16c257a512ec7f451c9fccf9ff455065b285b" | ||
38 | SRCREV_FORMAT = "openvino_mkl_onednn_xbyak_json_ade_protobuf_gflags_zlib_node-api-headers_node-addon-api_mlas_telemetry" | ||
39 | |||
40 | LICENSE = "Apache-2.0 & MIT & BSD-3-Clause & Zlib" | ||
41 | LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \ | ||
42 | file://thirdparty/xbyak/COPYRIGHT;md5=3c98edfaa50a86eeaef4c6109e803f16 \ | ||
43 | file://thirdparty/cnpy/LICENSE;md5=689f10b06d1ca2d4b1057e67b16cd580 \ | ||
44 | file://thirdparty/json/nlohmann_json/LICENSE.MIT;md5=f969127d7b7ed0a8a63c2bbeae002588 \ | ||
45 | file://thirdparty/ade/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \ | ||
46 | file://thirdparty/gflags/gflags/COPYING.txt;md5=c80d1a3b623f72bb85a4c75b556551df \ | ||
47 | file://thirdparty/zlib/zlib/LICENSE;md5=b51a40671bc46e961c0498897742c0b8 \ | ||
48 | file://src/plugins/intel_cpu/thirdparty/mlas/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \ | ||
49 | file://src/plugins/intel_cpu/thirdparty/onednn/LICENSE;md5=3b64000f6e7d52516017622a37a94ce9 \ | ||
50 | file://src/plugins/intel_gpu/thirdparty/onednn_gpu/LICENSE;md5=3b64000f6e7d52516017622a37a94ce9 \ | ||
51 | file://node-api-headers-src/LICENSE;md5=6adb2909701d4605b4b2ae1a9b25d8bd \ | ||
52 | file://node-addon-api-src/LICENSE.md;md5=0492ef29a9d558a3e9660e7accc9ca6a \ | ||
53 | file://thirdparty/telemetry/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \ | ||
54 | " | ||
55 | |||
56 | inherit cmake python3native pkgconfig qemu | ||
57 | |||
58 | S = "${WORKDIR}/git" | ||
59 | EXTRA_OECMAKE += " \ | ||
60 | -DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper \ | ||
61 | -DENABLE_OPENCV=OFF \ | ||
62 | -DENABLE_INTEL_GNA=OFF \ | ||
63 | -DENABLE_SYSTEM_TBB=ON \ | ||
64 | -DPYTHON_EXECUTABLE=${PYTHON} \ | ||
65 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ | ||
66 | -DTHREADING=TBB -DTBB_DIR="${STAGING_LIBDIR}/cmake/TBB" \ | ||
67 | -DTREAT_WARNING_AS_ERROR=FALSE \ | ||
68 | -DENABLE_DATA=FALSE \ | ||
69 | -DENABLE_SYSTEM_PUGIXML=TRUE \ | ||
70 | -DENABLE_OV_ONNX_FRONTEND=FALSE \ | ||
71 | -DUSE_BUILD_TYPE_SUBFOLDER=OFF \ | ||
72 | -DENABLE_FUZZING=OFF \ | ||
73 | -DENABLE_TBBBIND_2_5=OFF \ | ||
74 | -DCPACK_GENERATOR=RPM \ | ||
75 | -DENABLE_SYSTEM_FLATBUFFERS=ON \ | ||
76 | -DENABLE_SYSTEM_SNAPPY=ON \ | ||
77 | -DFETCHCONTENT_BASE_DIR="${S}" \ | ||
78 | -DENABLE_INTEL_NPU=OFF \ | ||
79 | " | ||
80 | |||
81 | DEPENDS += "\ | ||
82 | flatbuffers-native \ | ||
83 | pugixml \ | ||
84 | python3-pybind11 \ | ||
85 | python3-pybind11-native \ | ||
86 | qemu-native \ | ||
87 | snappy \ | ||
88 | tbb \ | ||
89 | " | ||
90 | |||
91 | COMPATIBLE_HOST = '(x86_64).*-linux' | ||
92 | COMPATIBLE_HOST:libc-musl = "null" | ||
93 | |||
94 | PACKAGECONFIG ?= "opencl samples" | ||
95 | PACKAGECONFIG[opencl] = "-DENABLE_INTEL_GPU=TRUE, -DENABLE_INTEL_GPU=FALSE, virtual/opencl-icd opencl-headers opencl-clhpp," | ||
96 | PACKAGECONFIG[python3] = "-DENABLE_PYTHON=ON -DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} -DENABLE_PYTHON_PACKAGING=ON, -DENABLE_PYTHON=OFF, patchelf-native, python3 python3-numpy python3-progress" | ||
97 | PACKAGECONFIG[samples] = "-DENABLE_SAMPLES=ON -DENABLE_COMPILE_TOOL=ON, -DENABLE_SAMPLES=OFF -DENABLE_COMPILE_TOOL=OFF, opencv" | ||
98 | PACKAGECONFIG[verbose] = "-DVERBOSE_BUILD=1,-DVERBOSE_BUILD=0" | ||
99 | |||
100 | do_configure:prepend() { | ||
101 | # Dont set PROJECT_ROOT_DIR | ||
102 | sed -i -e 's:\${OpenVINO_SOURCE_DIR}::;' ${S}/src/CMakeLists.txt | ||
103 | |||
104 | # qemu wrapper that can be used by cmake to run target binaries. | ||
105 | qemu_binary="${@qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'), [d.expand('${STAGING_DIR_HOST}${libdir}'),d.expand('${STAGING_DIR_HOST}${base_libdir}')])}" | ||
106 | cat > ${WORKDIR}/qemuwrapper << EOF | ||
107 | #!/bin/sh | ||
108 | $qemu_binary "\$@" | ||
109 | EOF | ||
110 | chmod +x ${WORKDIR}/qemuwrapper | ||
111 | } | ||
112 | |||
113 | do_install:append() { | ||
114 | rm -rf ${D}${prefix}/install_dependencies | ||
115 | rm -rf ${D}${prefix}/setupvars.sh | ||
116 | |||
117 | find ${B}/src/plugins/intel_cpu/cross-compiled/ -type f -name *_disp.cpp -exec sed -i -e 's%'"${S}"'%'"${TARGET_DBGSRC_DIR}"'%g' {} + | ||
118 | } | ||
119 | |||
120 | # Otherwise e.g. ros-openvino-toolkit-dynamic-vino-sample when using dldt-inference-engine uses dldt-inference-engine WORKDIR | ||
121 | # instead of RSS | ||
122 | SSTATE_SCAN_FILES:append = " *.cmake" | ||
123 | |||
124 | FILES:${PN} += "\ | ||
125 | ${libdir}/openvino-${PV}/lib*${SOLIBSDEV} \ | ||
126 | ${libdir}/openvino-${PV}/plugins.xml \ | ||
127 | ${libdir}/openvino-${PV}/cache.json \ | ||
128 | " | ||
129 | |||
130 | # Move inference engine samples into a separate package | ||
131 | PACKAGES =+ "${PN}-samples" | ||
132 | |||
133 | FILES:${PN}-samples = "${datadir}/openvino \ | ||
134 | ${bindir} \ | ||
135 | ${libdir}/libformat_reader.a \ | ||
136 | ${libdir}/libopencv_c_wrapper.a \ | ||
137 | " | ||
138 | |||
139 | RDEPENDS:${PN}-samples += "python3-core" | ||
140 | |||
141 | # Package for inference engine python API | ||
142 | PACKAGES =+ "${PN}-python3" | ||
143 | |||
144 | FILES:${PN}-python3 = "${PYTHON_SITEPACKAGES_DIR}" | ||
145 | |||
146 | UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+\.\d+\.\d+))$" | ||
diff --git a/lib/oeqa/runtime/cases/dldt_inference_engine.py b/lib/oeqa/runtime/cases/dldt_inference_engine.py deleted file mode 100644 index fb35d52f..00000000 --- a/lib/oeqa/runtime/cases/dldt_inference_engine.py +++ /dev/null | |||
@@ -1,109 +0,0 @@ | |||
1 | from oeqa.runtime.case import OERuntimeTestCase | ||
2 | from oeqa.runtime.decorator.package import OEHasPackage | ||
3 | from oeqa.core.decorator.depends import OETestDepends | ||
4 | from oeqa.runtime.miutils.targets.oeqatarget import OEQATarget | ||
5 | from oeqa.runtime.miutils.tests.squeezenet_model_download_test import SqueezenetModelDownloadTest | ||
6 | from oeqa.runtime.miutils.tests.dldt_model_optimizer_test import DldtModelOptimizerTest | ||
7 | from oeqa.runtime.miutils.tests.dldt_inference_engine_test import DldtInferenceEngineTest | ||
8 | from oeqa.runtime.miutils.dldtutils import get_testdata_config | ||
9 | |||
10 | class DldtInferenceEngine(OERuntimeTestCase): | ||
11 | |||
12 | @classmethod | ||
13 | def setUpClass(cls): | ||
14 | cls.sqn_download = SqueezenetModelDownloadTest(OEQATarget(cls.tc.target), '/tmp/ie/md') | ||
15 | cls.sqn_download.setup() | ||
16 | cls.dldt_mo = DldtModelOptimizerTest(OEQATarget(cls.tc.target), '/tmp/ie/ir') | ||
17 | cls.dldt_mo.setup() | ||
18 | cls.dldt_ie = DldtInferenceEngineTest(OEQATarget(cls.tc.target), '/tmp/ie/inputs') | ||
19 | cls.dldt_ie.setup() | ||
20 | cls.ir_files_dir = cls.dldt_mo.work_dir | ||
21 | |||
22 | @classmethod | ||
23 | def tearDownClass(cls): | ||
24 | cls.dldt_ie.tear_down() | ||
25 | cls.dldt_mo.tear_down() | ||
26 | cls.sqn_download.tear_down() | ||
27 | |||
28 | @OEHasPackage(['dldt-model-optimizer']) | ||
29 | @OEHasPackage(['wget']) | ||
30 | def test_dldt_ie_can_create_ir_and_download_input(self): | ||
31 | proxy_port = get_testdata_config(self.tc.td, 'DLDT_PIP_PROXY') | ||
32 | if not proxy_port: | ||
33 | self.skipTest('Need to configure bitbake configuration (DLDT_PIP_PROXY="proxy.server:port").') | ||
34 | (status, output) = self.sqn_download.test_can_download_squeezenet_model(proxy_port) | ||
35 | self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) | ||
36 | (status, output) = self.sqn_download.test_can_download_squeezenet_prototxt(proxy_port) | ||
37 | self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) | ||
38 | |||
39 | mo_exe_dir = get_testdata_config(self.tc.td, 'DLDT_MO_EXE_DIR') | ||
40 | if not mo_exe_dir: | ||
41 | self.skipTest('Need to configure bitbake configuration (DLDT_MO_EXE_DIR="directory_to_mo.py").') | ||
42 | mo_files_dir = self.sqn_download.work_dir | ||
43 | (status, output) = self.dldt_mo.test_dldt_mo_can_create_ir(mo_exe_dir, mo_files_dir) | ||
44 | self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) | ||
45 | |||
46 | (status, output) = self.dldt_ie.test_can_download_input_file(proxy_port) | ||
47 | self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) | ||
48 | |||
49 | @OETestDepends(['dldt_inference_engine.DldtInferenceEngine.test_dldt_ie_can_create_ir_and_download_input']) | ||
50 | @OEHasPackage(['dldt-inference-engine']) | ||
51 | @OEHasPackage(['dldt-inference-engine-samples']) | ||
52 | def test_dldt_ie_classification_with_cpu(self): | ||
53 | (status, output) = self.dldt_ie.test_dldt_ie_classification_with_device('CPU', self.ir_files_dir) | ||
54 | self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) | ||
55 | |||
56 | @OETestDepends(['dldt_inference_engine.DldtInferenceEngine.test_dldt_ie_can_create_ir_and_download_input']) | ||
57 | @OEHasPackage(['dldt-inference-engine']) | ||
58 | @OEHasPackage(['dldt-inference-engine-samples']) | ||
59 | @OEHasPackage(['intel-compute-runtime']) | ||
60 | @OEHasPackage(['ocl-icd']) | ||
61 | def test_dldt_ie_classification_with_gpu(self): | ||
62 | (status, output) = self.dldt_ie.test_dldt_ie_classification_with_device('GPU', self.ir_files_dir) | ||
63 | self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) | ||
64 | |||
65 | @OETestDepends(['dldt_inference_engine.DldtInferenceEngine.test_dldt_ie_can_create_ir_and_download_input']) | ||
66 | @OEHasPackage(['dldt-inference-engine']) | ||
67 | @OEHasPackage(['dldt-inference-engine-samples']) | ||
68 | @OEHasPackage(['dldt-inference-engine-vpu-firmware']) | ||
69 | def test_dldt_ie_classification_with_myriad(self): | ||
70 | device = 'MYRIAD' | ||
71 | (status, output) = self.dldt_ie.test_check_if_openvino_device_available(device) | ||
72 | if not status: | ||
73 | self.skipTest('OpenVINO %s device not available on target machine(availalbe devices: %s)' % (device, output)) | ||
74 | (status, output) = self.dldt_ie.test_dldt_ie_classification_with_device(device, self.ir_files_dir) | ||
75 | self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) | ||
76 | |||
77 | @OETestDepends(['dldt_inference_engine.DldtInferenceEngine.test_dldt_ie_can_create_ir_and_download_input']) | ||
78 | @OEHasPackage(['dldt-inference-engine']) | ||
79 | @OEHasPackage(['dldt-inference-engine-python3']) | ||
80 | @OEHasPackage(['python3-opencv']) | ||
81 | @OEHasPackage(['python3-numpy']) | ||
82 | def test_dldt_ie_classification_python_api_with_cpu(self): | ||
83 | (status, output) = self.dldt_ie.test_dldt_ie_classification_python_api_with_device('CPU', self.ir_files_dir) | ||
84 | self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) | ||
85 | |||
86 | @OETestDepends(['dldt_inference_engine.DldtInferenceEngine.test_dldt_ie_can_create_ir_and_download_input']) | ||
87 | @OEHasPackage(['dldt-inference-engine']) | ||
88 | @OEHasPackage(['dldt-inference-engine-python3']) | ||
89 | @OEHasPackage(['intel-compute-runtime']) | ||
90 | @OEHasPackage(['ocl-icd']) | ||
91 | @OEHasPackage(['python3-opencv']) | ||
92 | @OEHasPackage(['python3-numpy']) | ||
93 | def test_dldt_ie_classification_python_api_with_gpu(self): | ||
94 | (status, output) = self.dldt_ie.test_dldt_ie_classification_python_api_with_device('GPU', self.ir_files_dir) | ||
95 | self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) | ||
96 | |||
97 | @OETestDepends(['dldt_inference_engine.DldtInferenceEngine.test_dldt_ie_can_create_ir_and_download_input']) | ||
98 | @OEHasPackage(['dldt-inference-engine']) | ||
99 | @OEHasPackage(['dldt-inference-engine-python3']) | ||
100 | @OEHasPackage(['dldt-inference-engine-vpu-firmware']) | ||
101 | @OEHasPackage(['python3-opencv']) | ||
102 | @OEHasPackage(['python3-numpy']) | ||
103 | def test_dldt_ie_classification_python_api_with_myriad(self): | ||
104 | device = 'MYRIAD' | ||
105 | (status, output) = self.dldt_ie.test_check_if_openvino_device_available(device) | ||
106 | if not status: | ||
107 | self.skipTest('OpenVINO %s device not available on target machine(availalbe devices: %s)' % (device, output)) | ||
108 | (status, output) = self.dldt_ie.test_dldt_ie_classification_python_api_with_device(device, self.ir_files_dir) | ||
109 | self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) | ||
diff --git a/lib/oeqa/runtime/cases/dldt_model_optimizer.py b/lib/oeqa/runtime/cases/dldt_model_optimizer.py deleted file mode 100644 index 736ea661..00000000 --- a/lib/oeqa/runtime/cases/dldt_model_optimizer.py +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | from oeqa.runtime.case import OERuntimeTestCase | ||
2 | from oeqa.runtime.decorator.package import OEHasPackage | ||
3 | from oeqa.runtime.miutils.targets.oeqatarget import OEQATarget | ||
4 | from oeqa.runtime.miutils.tests.squeezenet_model_download_test import SqueezenetModelDownloadTest | ||
5 | from oeqa.runtime.miutils.tests.dldt_model_optimizer_test import DldtModelOptimizerTest | ||
6 | from oeqa.runtime.miutils.dldtutils import get_testdata_config | ||
7 | |||
8 | class DldtModelOptimizer(OERuntimeTestCase): | ||
9 | |||
10 | @classmethod | ||
11 | def setUpClass(cls): | ||
12 | cls.sqn_download = SqueezenetModelDownloadTest(OEQATarget(cls.tc.target), '/tmp/mo/md') | ||
13 | cls.sqn_download.setup() | ||
14 | cls.dldt_mo = DldtModelOptimizerTest(OEQATarget(cls.tc.target), '/tmp/mo/ir') | ||
15 | cls.dldt_mo.setup() | ||
16 | |||
17 | @classmethod | ||
18 | def tearDownClass(cls): | ||
19 | cls.dldt_mo.tear_down() | ||
20 | cls.sqn_download.tear_down() | ||
21 | |||
22 | @OEHasPackage(['dldt-model-optimizer']) | ||
23 | @OEHasPackage(['wget']) | ||
24 | def test_dldt_mo_can_create_ir(self): | ||
25 | proxy_port = get_testdata_config(self.tc.td, 'DLDT_PIP_PROXY') | ||
26 | if not proxy_port: | ||
27 | self.skipTest('Need to configure bitbake configuration (DLDT_PIP_PROXY="proxy.server:port").') | ||
28 | (status, output) = self.sqn_download.test_can_download_squeezenet_model(proxy_port) | ||
29 | self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) | ||
30 | (status, output) = self.sqn_download.test_can_download_squeezenet_prototxt(proxy_port) | ||
31 | self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) | ||
32 | |||
33 | mo_exe_dir = get_testdata_config(self.tc.td, 'DLDT_MO_EXE_DIR') | ||
34 | if not mo_exe_dir: | ||
35 | self.skipTest('Need to configure bitbake configuration (DLDT_MO_EXE_DIR="directory_to_mo.py").') | ||
36 | mo_files_dir = self.sqn_download.work_dir | ||
37 | (status, output) = self.dldt_mo.test_dldt_mo_can_create_ir(mo_exe_dir, mo_files_dir) | ||
38 | self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) | ||
diff --git a/lib/oeqa/runtime/files/dldt-inference-engine/classification_sample.py b/lib/oeqa/runtime/files/dldt-inference-engine/classification_sample.py deleted file mode 100644 index 1906e9fe..00000000 --- a/lib/oeqa/runtime/files/dldt-inference-engine/classification_sample.py +++ /dev/null | |||
@@ -1,135 +0,0 @@ | |||
1 | #!/usr/bin/env python3 | ||
2 | """ | ||
3 | Copyright (C) 2018-2019 Intel Corporation | ||
4 | |||
5 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | you may not use this file except in compliance with the License. | ||
7 | You may obtain a copy of the License at | ||
8 | |||
9 | http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | |||
11 | Unless required by applicable law or agreed to in writing, software | ||
12 | distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | See the License for the specific language governing permissions and | ||
15 | limitations under the License. | ||
16 | """ | ||
17 | from __future__ import print_function | ||
18 | import sys | ||
19 | import os | ||
20 | from argparse import ArgumentParser, SUPPRESS | ||
21 | import cv2 | ||
22 | import numpy as np | ||
23 | import logging as log | ||
24 | from time import time | ||
25 | from openvino.inference_engine import IENetwork, IECore | ||
26 | |||
27 | |||
28 | def build_argparser(): | ||
29 | parser = ArgumentParser(add_help=False) | ||
30 | args = parser.add_argument_group('Options') | ||
31 | args.add_argument('-h', '--help', action='help', default=SUPPRESS, help='Show this help message and exit.') | ||
32 | args.add_argument("-m", "--model", help="Required. Path to an .xml file with a trained model.", required=True, | ||
33 | type=str) | ||
34 | args.add_argument("-i", "--input", help="Required. Path to a folder with images or path to an image files", | ||
35 | required=True, | ||
36 | type=str, nargs="+") | ||
37 | args.add_argument("-l", "--cpu_extension", | ||
38 | help="Optional. Required for CPU custom layers. " | ||
39 | "MKLDNN (CPU)-targeted custom layers. Absolute path to a shared library with the" | ||
40 | " kernels implementations.", type=str, default=None) | ||
41 | args.add_argument("-d", "--device", | ||
42 | help="Optional. Specify the target device to infer on; CPU, GPU, FPGA, HDDL, MYRIAD or HETERO: is " | ||
43 | "acceptable. The sample will look for a suitable plugin for device specified. Default " | ||
44 | "value is CPU", | ||
45 | default="CPU", type=str) | ||
46 | args.add_argument("--labels", help="Optional. Path to a labels mapping file", default=None, type=str) | ||
47 | args.add_argument("-nt", "--number_top", help="Optional. Number of top results", default=10, type=int) | ||
48 | |||
49 | return parser | ||
50 | |||
51 | |||
52 | def main(): | ||
53 | log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) | ||
54 | args = build_argparser().parse_args() | ||
55 | model_xml = args.model | ||
56 | model_bin = os.path.splitext(model_xml)[0] + ".bin" | ||
57 | |||
58 | # Plugin initialization for specified device and load extensions library if specified | ||
59 | log.info("Creating Inference Engine") | ||
60 | ie = IECore() | ||
61 | if args.cpu_extension and 'CPU' in args.device: | ||
62 | ie.add_extension(args.cpu_extension, "CPU") | ||
63 | # Read IR | ||
64 | log.info("Loading network files:\n\t{}\n\t{}".format(model_xml, model_bin)) | ||
65 | net = IENetwork(model=model_xml, weights=model_bin) | ||
66 | |||
67 | if "CPU" in args.device: | ||
68 | supported_layers = ie.query_network(net, "CPU") | ||
69 | not_supported_layers = [l for l in net.layers.keys() if l not in supported_layers] | ||
70 | if len(not_supported_layers) != 0: | ||
71 | log.error("Following layers are not supported by the plugin for specified device {}:\n {}". | ||
72 | format(args.device, ', '.join(not_supported_layers))) | ||
73 | log.error("Please try to specify cpu extensions library path in sample's command line parameters using -l " | ||
74 | "or --cpu_extension command line argument") | ||
75 | sys.exit(1) | ||
76 | |||
77 | assert len(net.inputs.keys()) == 1, "Sample supports only single input topologies" | ||
78 | assert len(net.outputs) == 1, "Sample supports only single output topologies" | ||
79 | |||
80 | log.info("Preparing input blobs") | ||
81 | input_blob = next(iter(net.inputs)) | ||
82 | out_blob = next(iter(net.outputs)) | ||
83 | net.batch_size = len(args.input) | ||
84 | |||
85 | # Read and pre-process input images | ||
86 | n, c, h, w = net.inputs[input_blob].shape | ||
87 | images = np.ndarray(shape=(n, c, h, w)) | ||
88 | for i in range(n): | ||
89 | image = cv2.imread(args.input[i]) | ||
90 | if image.shape[:-1] != (h, w): | ||
91 | log.warning("Image {} is resized from {} to {}".format(args.input[i], image.shape[:-1], (h, w))) | ||
92 | image = cv2.resize(image, (w, h)) | ||
93 | image = image.transpose((2, 0, 1)) # Change data layout from HWC to CHW | ||
94 | images[i] = image | ||
95 | log.info("Batch size is {}".format(n)) | ||
96 | |||
97 | # Loading model to the plugin | ||
98 | log.info("Loading model to the plugin") | ||
99 | exec_net = ie.load_network(network=net, device_name=args.device) | ||
100 | |||
101 | # Start sync inference | ||
102 | log.info("Starting inference in synchronous mode") | ||
103 | res = exec_net.infer(inputs={input_blob: images}) | ||
104 | |||
105 | # Processing output blob | ||
106 | log.info("Processing output blob") | ||
107 | res = res[out_blob] | ||
108 | log.info("Top {} results: ".format(args.number_top)) | ||
109 | if args.labels: | ||
110 | with open(args.labels, 'r') as f: | ||
111 | labels_map = [x.split(sep=' ', maxsplit=1)[-1].strip() for x in f] | ||
112 | else: | ||
113 | labels_map = None | ||
114 | classid_str = "classid" | ||
115 | probability_str = "probability" | ||
116 | for i, probs in enumerate(res): | ||
117 | probs = np.squeeze(probs) | ||
118 | top_ind = np.argsort(probs)[-args.number_top:][::-1] | ||
119 | print("Image {}\n".format(args.input[i])) | ||
120 | print(classid_str, probability_str) | ||
121 | print("{} {}".format('-' * len(classid_str), '-' * len(probability_str))) | ||
122 | for id in top_ind: | ||
123 | det_label = labels_map[id] if labels_map else "{}".format(id) | ||
124 | label_length = len(det_label) | ||
125 | space_num_before = (len(classid_str) - label_length) // 2 | ||
126 | space_num_after = len(classid_str) - (space_num_before + label_length) + 2 | ||
127 | space_num_before_prob = (len(probability_str) - len(str(probs[id]))) // 2 | ||
128 | print("{}{}{}{}{:.7f}".format(' ' * space_num_before, det_label, | ||
129 | ' ' * space_num_after, ' ' * space_num_before_prob, | ||
130 | probs[id])) | ||
131 | print("\n") | ||
132 | log.info("This sample is an API example, for any performance measurements please use the dedicated benchmark_app tool\n") | ||
133 | |||
134 | if __name__ == '__main__': | ||
135 | sys.exit(main() or 0) | ||
diff --git a/lib/oeqa/runtime/miutils/dldtutils.py b/lib/oeqa/runtime/miutils/dldtutils.py deleted file mode 100644 index 45bf2e12..00000000 --- a/lib/oeqa/runtime/miutils/dldtutils.py +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | |||
2 | def get_testdata_config(testdata, config): | ||
3 | return testdata.get(config) | ||
diff --git a/lib/oeqa/runtime/miutils/tests/dldt_inference_engine_test.py b/lib/oeqa/runtime/miutils/tests/dldt_inference_engine_test.py deleted file mode 100644 index 31bfb539..00000000 --- a/lib/oeqa/runtime/miutils/tests/dldt_inference_engine_test.py +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | import os | ||
2 | script_path = os.path.dirname(os.path.realpath(__file__)) | ||
3 | files_path = os.path.join(script_path, '../../files/') | ||
4 | |||
5 | class DldtInferenceEngineTest(object): | ||
6 | ie_input_files = {'ie_python_sample': 'classification_sample.py', | ||
7 | 'input': 'chicky_512.png', | ||
8 | 'input_download': 'https://raw.githubusercontent.com/opencv/opencv/master/samples/data/chicky_512.png', | ||
9 | 'model': 'squeezenet_v1.1.xml'} | ||
10 | |||
11 | def __init__(self, target, work_dir): | ||
12 | self.target = target | ||
13 | self.work_dir = work_dir | ||
14 | |||
15 | def setup(self): | ||
16 | self.target.run('mkdir -p %s' % self.work_dir) | ||
17 | self.target.copy_to(os.path.join(files_path, 'dldt-inference-engine', self.ie_input_files['ie_python_sample']), | ||
18 | self.work_dir) | ||
19 | python_cmd = 'from openvino.inference_engine import IENetwork, IECore; ie = IECore(); print(ie.available_devices)' | ||
20 | __, output = self.target.run('python3 -c "%s"' % python_cmd) | ||
21 | self.available_devices = output | ||
22 | |||
23 | def tear_down(self): | ||
24 | self.target.run('rm -rf %s' % self.work_dir) | ||
25 | |||
26 | def test_check_if_openvino_device_available(self, device): | ||
27 | if device not in self.available_devices: | ||
28 | return False, self.available_devices | ||
29 | return True, self.available_devices | ||
30 | |||
31 | def test_can_download_input_file(self, proxy_port): | ||
32 | return self.target.run('cd %s; wget %s -e https_proxy=%s' % | ||
33 | (self.work_dir, | ||
34 | self.ie_input_files['input_download'], | ||
35 | proxy_port)) | ||
36 | |||
37 | def test_dldt_ie_classification_with_device(self, device, ir_files_dir): | ||
38 | return self.target.run('classification_sample_async -d %s -i %s -m %s' % | ||
39 | (device, | ||
40 | os.path.join(self.work_dir, self.ie_input_files['input']), | ||
41 | os.path.join(ir_files_dir, self.ie_input_files['model']))) | ||
42 | |||
43 | def test_dldt_ie_classification_python_api_with_device(self, device, ir_files_dir, extension=''): | ||
44 | if extension: | ||
45 | return self.target.run('python3 %s -d %s -i %s -m %s -l %s' % | ||
46 | (os.path.join(self.work_dir, self.ie_input_files['ie_python_sample']), | ||
47 | device, | ||
48 | os.path.join(self.work_dir, self.ie_input_files['input']), | ||
49 | os.path.join(ir_files_dir, self.ie_input_files['model']), | ||
50 | extension)) | ||
51 | else: | ||
52 | return self.target.run('python3 %s -d %s -i %s -m %s' % | ||
53 | (os.path.join(self.work_dir, self.ie_input_files['ie_python_sample']), | ||
54 | device, | ||
55 | os.path.join(self.work_dir, self.ie_input_files['input']), | ||
56 | os.path.join(ir_files_dir, self.ie_input_files['model']))) | ||
diff --git a/lib/oeqa/runtime/miutils/tests/dldt_model_optimizer_test.py b/lib/oeqa/runtime/miutils/tests/dldt_model_optimizer_test.py deleted file mode 100644 index 7d3db15b..00000000 --- a/lib/oeqa/runtime/miutils/tests/dldt_model_optimizer_test.py +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | import os | ||
2 | |||
3 | class DldtModelOptimizerTest(object): | ||
4 | mo_input_files = {'model': 'squeezenet_v1.1.caffemodel', | ||
5 | 'prototxt': 'deploy.prototxt'} | ||
6 | mo_exe = 'mo.py' | ||
7 | |||
8 | def __init__(self, target, work_dir): | ||
9 | self.target = target | ||
10 | self.work_dir = work_dir | ||
11 | |||
12 | def setup(self): | ||
13 | self.target.run('mkdir -p %s' % self.work_dir) | ||
14 | |||
15 | def tear_down(self): | ||
16 | self.target.run('rm -rf %s' % self.work_dir) | ||
17 | |||
18 | def test_dldt_mo_can_create_ir(self, mo_exe_dir, mo_files_dir): | ||
19 | return self.target.run('python3 %s --input_model %s --input_proto %s --output_dir %s --data_type FP16' % | ||
20 | (os.path.join(mo_exe_dir, self.mo_exe), | ||
21 | os.path.join(mo_files_dir, self.mo_input_files['model']), | ||
22 | os.path.join(mo_files_dir, self.mo_input_files['prototxt']), | ||
23 | self.work_dir)) | ||
diff --git a/lib/oeqa/runtime/miutils/tests/squeezenet_model_download_test.py b/lib/oeqa/runtime/miutils/tests/squeezenet_model_download_test.py deleted file mode 100644 index a3e46a0a..00000000 --- a/lib/oeqa/runtime/miutils/tests/squeezenet_model_download_test.py +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | class SqueezenetModelDownloadTest(object): | ||
2 | download_files = {'squeezenet1.1.prototxt': 'https://raw.githubusercontent.com/DeepScale/SqueezeNet/a47b6f13d30985279789d08053d37013d67d131b/SqueezeNet_v1.1/deploy.prototxt', | ||
3 | 'squeezenet1.1.caffemodel': 'https://github.com/DeepScale/SqueezeNet/raw/a47b6f13d30985279789d08053d37013d67d131b/SqueezeNet_v1.1/squeezenet_v1.1.caffemodel'} | ||
4 | |||
5 | def __init__(self, target, work_dir): | ||
6 | self.target = target | ||
7 | self.work_dir = work_dir | ||
8 | |||
9 | def setup(self): | ||
10 | self.target.run('mkdir -p %s' % self.work_dir) | ||
11 | |||
12 | def tear_down(self): | ||
13 | self.target.run('rm -rf %s' % self.work_dir) | ||
14 | |||
15 | def test_can_download_squeezenet_model(self, proxy_port): | ||
16 | return self.target.run('cd %s; wget %s -e https_proxy=%s' % | ||
17 | (self.work_dir, | ||
18 | self.download_files['squeezenet1.1.caffemodel'], | ||
19 | proxy_port)) | ||
20 | |||
21 | def test_can_download_squeezenet_prototxt(self, proxy_port): | ||
22 | return self.target.run('cd %s; wget %s -e https_proxy=%s' % | ||
23 | (self.work_dir, | ||
24 | self.download_files['squeezenet1.1.prototxt'], | ||
25 | proxy_port)) | ||