Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[E-103104] - Port G-API demos to API2.0 #3887

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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());
Comment on lines -156 to +157
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TolyaTalamanov should probably align these APIs between ie::Params<> and ov::Params<>

// 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
21 changes: 12 additions & 9 deletions demos/tests/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,18 @@ 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,
}),
single_option_cases('-m',
ModelArg('instance-segmentation-person-0007'),
ModelArg('instance-segmentation-security-0091')),
single_option_cases(
'-i',
str('video.mp4'),
DataPatternArg('coco128-every-480x640x3')),
)),

CppDemo('classification_benchmark_demo', 'cpp_gapi', test_cases=combine_cases(
single_option_cases(
Expand Down
Loading