Skip to content

Commit 0044eda

Browse files
Port G-API demos to API2.0
1 parent 8c9bc0d commit 0044eda

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

demos/background_subtraction_demo/cpp_gapi/main.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <opencv2/gapi/imgproc.hpp>
2929
#include <opencv2/gapi/infer.hpp>
3030
#include <opencv2/gapi/infer/ie.hpp>
31+
#include <opencv2/gapi/infer/ov.hpp>
3132
#include <opencv2/gapi/own/assert.hpp>
3233
#include <opencv2/gapi/streaming/source.hpp>
3334
#include <opencv2/gapi/util/optional.hpp>
@@ -147,13 +148,13 @@ int main(int argc, char* argv[]) {
147148
auto config = ConfigFactory::getUserConfig(FLAGS_d, FLAGS_nireq, FLAGS_nstreams, FLAGS_nthreads);
148149
// clang-format off
149150
const auto net =
150-
cv::gapi::ie::Params<cv::gapi::Generic>{
151+
cv::gapi::ov::Params<cv::gapi::Generic>{
151152
model->getName(),
152153
FLAGS_m, // path to topology IR
153154
fileNameNoExt(FLAGS_m) + ".bin", // path to weights
154155
FLAGS_d // device specifier
155156
}.cfgNumRequests(config.maxAsyncRequests)
156-
.pluginConfig(config.getLegacyConfig());
157+
.cfgPluginConfig(config.getLegacyConfig());
157158
// clang-format on
158159

159160
slog::info << "The background matting model " << FLAGS_m << " is loaded to " << FLAGS_d << " device."

demos/gesture_recognition_demo/cpp_gapi/main.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <opencv2/gapi/gstreaming.hpp>
2727
#include <opencv2/gapi/infer.hpp>
2828
#include <opencv2/gapi/infer/ie.hpp>
29+
#include <opencv2/gapi/infer/ov.hpp>
2930
#include <opencv2/gapi/streaming/source.hpp>
3031
#include <opencv2/highgui.hpp>
3132
#include <opencv2/imgproc.hpp>
@@ -135,7 +136,7 @@ int main(int argc, char* argv[]) {
135136
/** Configure networks **/
136137
// clang-format off
137138
auto person_detection =
138-
cv::gapi::ie::Params<nets::PersonDetection>{
139+
cv::gapi::ov::Params<nets::PersonDetection>{
139140
FLAGS_m_d, // path to model
140141
fileNameNoExt(FLAGS_m_d) + ".bin", // path to weights
141142
FLAGS_d_d // device to use
@@ -148,7 +149,7 @@ int main(int argc, char* argv[]) {
148149

149150
// clang-format off
150151
auto action_recognition =
151-
cv::gapi::ie::Params<nets::ActionRecognition>{
152+
cv::gapi::ov::Params<nets::ActionRecognition>{
152153
FLAGS_m_a, // path to model
153154
fileNameNoExt(FLAGS_m_a) + ".bin", // path to weights
154155
FLAGS_d_a // device to use

demos/tests/cases.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,15 @@ def single_option_cases(key, *args):
170170

171171

172172
DEMOS = [
173-
# CppDemo(name='background_subtraction_demo', device_keys=['-d'], implementation='cpp_gapi', test_cases=combine_cases(
174-
# TestCase(options={'--no_show': None, '-at': 'maskrcnn',
175-
# **MONITORS,
176-
# '-i': DataPatternArg('coco128-subset-480x640x3'),
177-
# }),
178-
# single_option_cases('-m',
179-
# ModelArg('instance-segmentation-person-0007'),
180-
# ModelArg('instance-segmentation-security-0091')),
181-
# )),
173+
CppDemo(name='background_subtraction_demo', device_keys=['-d'], implementation='cpp_gapi', test_cases=combine_cases(
174+
TestCase(options={'--no_show': None, '-at': 'maskrcnn',
175+
**MONITORS,
176+
'-i': DataPatternArg('coco128-subset-480x640x3'),
177+
}),
178+
single_option_cases('-m',
179+
ModelArg('instance-segmentation-person-0007'),
180+
ModelArg('instance-segmentation-security-0091')),
181+
)),
182182

183183
CppDemo('classification_benchmark_demo', 'cpp_gapi', test_cases=combine_cases(
184184
single_option_cases(

0 commit comments

Comments
 (0)