Skip to content

Commit 40d8c31

Browse files
Port G-API demo (gaze_estimation_demo_gapi) to API2.0
1 parent f1f7361 commit 40d8c31

File tree

1 file changed

+7
-6
lines changed
  • demos/gaze_estimation_demo/cpp_gapi

1 file changed

+7
-6
lines changed

demos/gaze_estimation_demo/cpp_gapi/main.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <opencv2/gapi/gstreaming.hpp>
3232
#include <opencv2/gapi/infer.hpp>
3333
#include <opencv2/gapi/infer/ie.hpp>
34+
#include <opencv2/gapi/infer/ov.hpp>
3435
#include <opencv2/gapi/streaming/format.hpp>
3536
#include <opencv2/highgui.hpp>
3637
#include <opencv2/imgproc.hpp>
@@ -175,7 +176,7 @@ int main(int argc, char* argv[]) {
175176
processed_gaze_vectors));
176177
/** ---------------- End of graph ---------------- **/
177178
/** Configure networks **/
178-
auto face_net = cv::gapi::ie::Params<nets::Faces>{
179+
auto face_net = cv::gapi::ov::Params<nets::Faces>{
179180
FLAGS_m_fd, // path to topology IR
180181
fileNameNoExt(FLAGS_m_fd) + ".bin", // path to weights
181182
FLAGS_d_fd, // device specifier
@@ -210,11 +211,11 @@ int main(int argc, char* argv[]) {
210211

211212
if (std::fabs(imageAspectRatio - networkAspectRatio) > aspectRatioThreshold) {
212213
inShape[3] = static_cast<unsigned long>(inShape[2] * imageAspectRatio);
213-
face_net.cfgInputReshape(input.get_any_name(), inShape);
214+
face_net.cfgReshape(inShape);
214215
}
215216
}
216217
auto head_net =
217-
cv::gapi::ie::Params<nets::HeadPose>{
218+
cv::gapi::ov::Params<nets::HeadPose>{
218219
FLAGS_m_hp, // path to topology IR
219220
fileNameNoExt(FLAGS_m_hp) + ".bin", // path to weights
220221
FLAGS_d_hp, // device specifier
@@ -223,7 +224,7 @@ int main(int argc, char* argv[]) {
223224
slog::info << "The Head Pose Estimation model " << FLAGS_m_hp << " is loaded to " << FLAGS_d_hp << " device."
224225
<< slog::endl;
225226

226-
auto landmarks_net = cv::gapi::ie::Params<nets::Landmarks>{
227+
auto landmarks_net = cv::gapi::ov::Params<nets::Landmarks>{
227228
FLAGS_m_lm, // path to topology IR
228229
fileNameNoExt(FLAGS_m_lm) + ".bin", // path to weights
229230
FLAGS_d_lm, // device specifier
@@ -233,7 +234,7 @@ int main(int argc, char* argv[]) {
233234

234235
// clang-format off
235236
auto gaze_net =
236-
cv::gapi::ie::Params<nets::Gaze>{
237+
cv::gapi::ov::Params<nets::Gaze>{
237238
FLAGS_m, // path to topology IR
238239
fileNameNoExt(FLAGS_m) + ".bin", // path to weights
239240
FLAGS_d, // device specifier
@@ -242,7 +243,7 @@ int main(int argc, char* argv[]) {
242243
slog::info << "The Gaze Estimation model " << FLAGS_m << " is loaded to " << FLAGS_d << " device."
243244
<< slog::endl;
244245

245-
auto eyes_net = cv::gapi::ie::Params<nets::Eyes>{
246+
auto eyes_net = cv::gapi::ov::Params<nets::Eyes>{
246247
FLAGS_m_es, // path to topology IR
247248
fileNameNoExt(FLAGS_m_es) + ".bin", // path to weights
248249
FLAGS_d_es, // device specifier

0 commit comments

Comments
 (0)