Skip to content

Commit 2e3ec27

Browse files
authored
Merge pull request #3627 from Wovchena/mart_classroom_demo_gapi-ov-2.0
smart_classroom_demo_gapi: ov 2.0
2 parents 393d2ea + 606fe07 commit 2e3ec27

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

demos/smart_classroom_demo/cpp_gapi/include/initialize.hpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
#include "kernel_packages.hpp"
2121
#include "recognizer.hpp"
2222

23-
#include <inference_engine.hpp>
24-
2523
namespace nets {
2624
G_API_NET(FaceDetector, <cv::GMat(cv::GMat)>, "face-detector");
2725
G_API_NET(LandmarksDetector, <cv::GMat(cv::GMat)>, "landmarks-detector");
@@ -217,10 +215,10 @@ void configNets(const NetsFlagsPack& flags, cv::gapi::GNetPackage& networks, cv:
217215
// clang-format on
218216

219217
networks += cv::gapi::networks(action_net);
220-
InferenceEngine::Core core;
221-
const auto layerData = core.ReadNetwork(flags.m_act).getInputsInfo().begin()->second;
222-
auto layerDims = layerData->getTensorDesc().getDims();
223-
act_net_in_size = {int(layerDims[3]), int(layerDims[2])};
218+
ov::Core core;
219+
const ov::Output<ov::Node>& input = core.read_model(flags.m_act)->input();
220+
const ov::Shape& in_shape = input.get_shape();
221+
act_net_in_size = {int(in_shape[2]), int(in_shape[1])};
224222
slog::info << "The Person/Action Detection model " << flags.m_act << " is loaded to " << flags.d_act
225223
<< " device." << slog::endl;
226224
} else {
@@ -271,13 +269,13 @@ void configNets(const NetsFlagsPack& flags, cv::gapi::GNetPackage& networks, cv:
271269
} else {
272270
slog::info << "Face Re-Identification DISABLED." << slog::endl;
273271
}
274-
InferenceEngine::Core core;
275-
const auto layerData = core.ReadNetwork(flags.m_reid).getInputsInfo().begin()->second;
276-
const auto layerDims = layerData->getTensorDesc().getDims();
277-
reid_net_in_size = {static_cast<double>(layerDims[0]),
278-
static_cast<double>(layerDims[1]),
279-
static_cast<double>(layerDims[2]),
280-
static_cast<double>(layerDims[3])};
272+
ov::Core core;
273+
const ov::Output<ov::Node>& input = core.read_model(flags.m_reid)->input();
274+
const ov::Shape& in_shape = input.get_shape();
275+
reid_net_in_size = {static_cast<double>(in_shape[0]),
276+
static_cast<double>(in_shape[1]),
277+
static_cast<double>(in_shape[2]),
278+
static_cast<double>(in_shape[3])};
281279
}
282280
}
283281
} // namespace config

0 commit comments

Comments
 (0)