From 0044eda3dfb4d7e21397dd2cf954cdad3c075b62 Mon Sep 17 00:00:00 2001 From: DariaMityagina Date: Fri, 5 Jan 2024 19:43:19 +0000 Subject: [PATCH] Port G-API demos to API2.0 --- .../cpp_gapi/main.cpp | 5 +++-- .../gesture_recognition_demo/cpp_gapi/main.cpp | 5 +++-- demos/tests/cases.py | 18 +++++++++--------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/demos/background_subtraction_demo/cpp_gapi/main.cpp b/demos/background_subtraction_demo/cpp_gapi/main.cpp index fb2769957fc..84637570618 100644 --- a/demos/background_subtraction_demo/cpp_gapi/main.cpp +++ b/demos/background_subtraction_demo/cpp_gapi/main.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -147,13 +148,13 @@ int main(int argc, char* argv[]) { auto config = ConfigFactory::getUserConfig(FLAGS_d, FLAGS_nireq, FLAGS_nstreams, FLAGS_nthreads); // clang-format off const auto net = - cv::gapi::ie::Params{ + cv::gapi::ov::Params{ model->getName(), FLAGS_m, // path to topology IR fileNameNoExt(FLAGS_m) + ".bin", // path to weights FLAGS_d // device specifier }.cfgNumRequests(config.maxAsyncRequests) - .pluginConfig(config.getLegacyConfig()); + .cfgPluginConfig(config.getLegacyConfig()); // clang-format on slog::info << "The background matting model " << FLAGS_m << " is loaded to " << FLAGS_d << " device." diff --git a/demos/gesture_recognition_demo/cpp_gapi/main.cpp b/demos/gesture_recognition_demo/cpp_gapi/main.cpp index 034cc72131a..c13b8407015 100644 --- a/demos/gesture_recognition_demo/cpp_gapi/main.cpp +++ b/demos/gesture_recognition_demo/cpp_gapi/main.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -135,7 +136,7 @@ int main(int argc, char* argv[]) { /** Configure networks **/ // clang-format off auto person_detection = - cv::gapi::ie::Params{ + cv::gapi::ov::Params{ FLAGS_m_d, // path to model fileNameNoExt(FLAGS_m_d) + ".bin", // path to weights FLAGS_d_d // device to use @@ -148,7 +149,7 @@ int main(int argc, char* argv[]) { // clang-format off auto action_recognition = - cv::gapi::ie::Params{ + cv::gapi::ov::Params{ FLAGS_m_a, // path to model fileNameNoExt(FLAGS_m_a) + ".bin", // path to weights FLAGS_d_a // device to use diff --git a/demos/tests/cases.py b/demos/tests/cases.py index 1c5a9c14643..279e8adfc1f 100644 --- a/demos/tests/cases.py +++ b/demos/tests/cases.py @@ -170,15 +170,15 @@ def single_option_cases(key, *args): DEMOS = [ - # CppDemo(name='background_subtraction_demo', device_keys=['-d'], implementation='cpp_gapi', test_cases=combine_cases( - # TestCase(options={'--no_show': None, '-at': 'maskrcnn', - # **MONITORS, - # '-i': DataPatternArg('coco128-subset-480x640x3'), - # }), - # single_option_cases('-m', - # ModelArg('instance-segmentation-person-0007'), - # ModelArg('instance-segmentation-security-0091')), - # )), + CppDemo(name='background_subtraction_demo', device_keys=['-d'], implementation='cpp_gapi', test_cases=combine_cases( + TestCase(options={'--no_show': None, '-at': 'maskrcnn', + **MONITORS, + '-i': DataPatternArg('coco128-subset-480x640x3'), + }), + single_option_cases('-m', + ModelArg('instance-segmentation-person-0007'), + ModelArg('instance-segmentation-security-0091')), + )), CppDemo('classification_benchmark_demo', 'cpp_gapi', test_cases=combine_cases( single_option_cases(