From c4ddbf832bbd71aa3939df8d87d5c54ad01097f2 Mon Sep 17 00:00:00 2001 From: DariaMityagina Date: Wed, 27 Dec 2023 18:05:42 +0000 Subject: [PATCH 1/2] Port to API2.0 : classification_benchmark_demo, face_detection_mtcnn_demo, interactive_face_detection_demo --- .../cpp_gapi/classification_benchmark_demo_gapi.hpp | 2 +- demos/face_detection_mtcnn_demo/cpp_gapi/main.cpp | 9 +++++---- .../cpp_gapi/main.cpp | 13 +++++++------ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/demos/classification_benchmark_demo/cpp_gapi/classification_benchmark_demo_gapi.hpp b/demos/classification_benchmark_demo/cpp_gapi/classification_benchmark_demo_gapi.hpp index 3215c0456ee..99ca73d10e5 100644 --- a/demos/classification_benchmark_demo/cpp_gapi/classification_benchmark_demo_gapi.hpp +++ b/demos/classification_benchmark_demo/cpp_gapi/classification_benchmark_demo_gapi.hpp @@ -51,7 +51,7 @@ DEFINE_string(res, "1280x720", image_grid_resolution_message); DEFINE_bool(no_show, false, no_show_message); DEFINE_uint32(time, std::numeric_limits::max(), execution_time_message); DEFINE_string(u, "", utilization_monitors_message); -DEFINE_string(backend, "IE", backend_message); +DEFINE_string(backend, "OV", backend_message); DEFINE_string(mean_values, "", mean_values_message); DEFINE_string(scale_values, "", scale_values_message); diff --git a/demos/face_detection_mtcnn_demo/cpp_gapi/main.cpp b/demos/face_detection_mtcnn_demo/cpp_gapi/main.cpp index 44e2aa92674..286a704d3ba 100644 --- a/demos/face_detection_mtcnn_demo/cpp_gapi/main.cpp +++ b/demos/face_detection_mtcnn_demo/cpp_gapi/main.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -191,7 +192,7 @@ int main(int argc, char* argv[]) { // MTCNN Refinement detection network // clang-format off auto mtcnnr_net = - cv::gapi::ie::Params{ + cv::gapi::ov::Params{ FLAGS_m_r, // path to topology IR fileNameNoExt(FLAGS_m_r) + ".bin", // path to weights FLAGS_d_r, // device specifier @@ -200,7 +201,7 @@ int main(int argc, char* argv[]) { // MTCNN Output detection network auto mtcnno_net = - cv::gapi::ie::Params{ + cv::gapi::ov::Params{ FLAGS_m_o, // path to topology IR fileNameNoExt(FLAGS_m_o) + ".bin", // path to weights FLAGS_d_o, // device specifier @@ -213,13 +214,13 @@ int main(int argc, char* argv[]) { for (int i = 0; i < pyramid_levels; ++i) { std::string net_id = get_pnet_level_name(level_size[i]); std::vector reshape_dims = {1, 3, size_t(level_size[i].width), size_t(level_size[i].height)}; - cv::gapi::ie::Params mtcnnp_net{ + cv::gapi::ov::Params mtcnnp_net{ net_id, // tag FLAGS_m_p, // path to topology IR fileNameNoExt(FLAGS_m_p) + ".bin", // path to weights FLAGS_d_p, // device specifier }; - mtcnnp_net.cfgInputReshape("data", reshape_dims); + mtcnnp_net.cfgReshape(reshape_dims); networks_mtcnn += cv::gapi::networks(mtcnnp_net); } diff --git a/demos/interactive_face_detection_demo/cpp_gapi/main.cpp b/demos/interactive_face_detection_demo/cpp_gapi/main.cpp index 5cd89a8f790..1ed23ace3f6 100644 --- a/demos/interactive_face_detection_demo/cpp_gapi/main.cpp +++ b/demos/interactive_face_detection_demo/cpp_gapi/main.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -469,7 +470,7 @@ int main(int argc, char* argv[]) { auto pipeline = cv::GComputation(cv::GIn(in), std::move(outs)); /** ---------------- End of graph ---------------- **/ /** Configure networks **/ - auto det_net = cv::gapi::ie::Params{ + auto det_net = cv::gapi::ov::Params{ FLAGS_m, // path to model fileNameNoExt(FLAGS_m) + ".bin", // path to weights FLAGS_d // device to use @@ -478,7 +479,7 @@ int main(int argc, char* argv[]) { // clang-format off auto age_net = - cv::gapi::ie::Params{ + cv::gapi::ov::Params{ FLAGS_mag, // path to model fileNameNoExt(FLAGS_mag) + ".bin", // path to weights FLAGS_dag // device to use @@ -494,7 +495,7 @@ int main(int argc, char* argv[]) { // clang-format off auto hp_net = - cv::gapi::ie::Params{ + cv::gapi::ov::Params{ FLAGS_mhp, // path to model fileNameNoExt(FLAGS_mhp) + ".bin", // path to weights FLAGS_dhp // device to use @@ -510,7 +511,7 @@ int main(int argc, char* argv[]) { // clang-format off auto lm_net = - cv::gapi::ie::Params{ + cv::gapi::ov::Params{ FLAGS_mlm, // path to model fileNameNoExt(FLAGS_mlm) + ".bin", // path to weights FLAGS_dlm // device to use @@ -524,7 +525,7 @@ int main(int argc, char* argv[]) { slog::info << "Facial Landmarks Estimation DISABLED." << slog::endl; } - auto am_net = cv::gapi::ie::Params{ + auto am_net = cv::gapi::ov::Params{ FLAGS_mam, // path to model fileNameNoExt(FLAGS_mam) + ".bin", // path to weights FLAGS_dam // device to use @@ -535,7 +536,7 @@ int main(int argc, char* argv[]) { slog::info << "Anti Spoof DISABLED." << slog::endl; } - auto emo_net = cv::gapi::ie::Params{ + auto emo_net = cv::gapi::ov::Params{ FLAGS_mem, // path to model fileNameNoExt(FLAGS_mem) + ".bin", // path to weights FLAGS_dem // device to use From 29f61fb94a09c26956378261f33ffad8fe4789bf Mon Sep 17 00:00:00 2001 From: DariaMityagina Date: Wed, 27 Dec 2023 18:29:08 +0000 Subject: [PATCH 2/2] Port to API2.0 : classification_benchmark_demo, face_detection_mtcnn_demo, interactive_face_detection_demo - review --- demos/face_detection_mtcnn_demo/cpp_gapi/main.cpp | 1 - demos/interactive_face_detection_demo/cpp_gapi/main.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/demos/face_detection_mtcnn_demo/cpp_gapi/main.cpp b/demos/face_detection_mtcnn_demo/cpp_gapi/main.cpp index 286a704d3ba..fcd4bd980fc 100644 --- a/demos/face_detection_mtcnn_demo/cpp_gapi/main.cpp +++ b/demos/face_detection_mtcnn_demo/cpp_gapi/main.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/demos/interactive_face_detection_demo/cpp_gapi/main.cpp b/demos/interactive_face_detection_demo/cpp_gapi/main.cpp index 1ed23ace3f6..c52d670bcc4 100644 --- a/demos/interactive_face_detection_demo/cpp_gapi/main.cpp +++ b/demos/interactive_face_detection_demo/cpp_gapi/main.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include