Skip to content

Commit

Permalink
Port G-API demos to API2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DariaMityagina committed Jan 30, 2024
1 parent 126fac1 commit c853d57
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
5 changes: 3 additions & 2 deletions demos/background_subtraction_demo/cpp_gapi/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <opencv2/gapi/imgproc.hpp>
#include <opencv2/gapi/infer.hpp>
#include <opencv2/gapi/infer/ie.hpp>
#include <opencv2/gapi/infer/ov.hpp>
#include <opencv2/gapi/own/assert.hpp>
#include <opencv2/gapi/streaming/source.hpp>
#include <opencv2/gapi/util/optional.hpp>
Expand Down Expand Up @@ -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::Generic>{
cv::gapi::ov::Params<cv::gapi::Generic>{
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."
Expand Down
5 changes: 3 additions & 2 deletions demos/gesture_recognition_demo/cpp_gapi/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <opencv2/gapi/gstreaming.hpp>
#include <opencv2/gapi/infer.hpp>
#include <opencv2/gapi/infer/ie.hpp>
#include <opencv2/gapi/infer/ov.hpp>
#include <opencv2/gapi/streaming/source.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
Expand Down Expand Up @@ -135,7 +136,7 @@ int main(int argc, char* argv[]) {
/** Configure networks **/
// clang-format off
auto person_detection =
cv::gapi::ie::Params<nets::PersonDetection>{
cv::gapi::ov::Params<nets::PersonDetection>{
FLAGS_m_d, // path to model
fileNameNoExt(FLAGS_m_d) + ".bin", // path to weights
FLAGS_d_d // device to use
Expand All @@ -148,7 +149,7 @@ int main(int argc, char* argv[]) {

// clang-format off
auto action_recognition =
cv::gapi::ie::Params<nets::ActionRecognition>{
cv::gapi::ov::Params<nets::ActionRecognition>{
FLAGS_m_a, // path to model
fileNameNoExt(FLAGS_m_a) + ".bin", // path to weights
FLAGS_d_a // device to use
Expand Down
18 changes: 9 additions & 9 deletions demos/tests/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit c853d57

Please sign in to comment.