Skip to content

Commit

Permalink
[E-103104] - Port G-API demos to API2.0 - part 1 (#3889)
Browse files Browse the repository at this point in the history
Port to API2.0 : classification_benchmark_demo, face_detection_mtcnn_demo, interactive_face_detection_demo
  • Loading branch information
DariaMityagina authored Dec 27, 2023
1 parent ba07662 commit f1f7361
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<gflags::uint32>::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);

Expand Down
10 changes: 5 additions & 5 deletions demos/face_detection_mtcnn_demo/cpp_gapi/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <opencv2/gapi/gstreaming.hpp>
#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/render/render.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
Expand Down Expand Up @@ -191,7 +191,7 @@ int main(int argc, char* argv[]) {
// MTCNN Refinement detection network
// clang-format off
auto mtcnnr_net =
cv::gapi::ie::Params<nets::MTCNNRefinement>{
cv::gapi::ov::Params<nets::MTCNNRefinement>{
FLAGS_m_r, // path to topology IR
fileNameNoExt(FLAGS_m_r) + ".bin", // path to weights
FLAGS_d_r, // device specifier
Expand All @@ -200,7 +200,7 @@ int main(int argc, char* argv[]) {

// MTCNN Output detection network
auto mtcnno_net =
cv::gapi::ie::Params<nets::MTCNNOutput>{
cv::gapi::ov::Params<nets::MTCNNOutput>{
FLAGS_m_o, // path to topology IR
fileNameNoExt(FLAGS_m_o) + ".bin", // path to weights
FLAGS_d_o, // device specifier
Expand All @@ -213,13 +213,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<size_t> reshape_dims = {1, 3, size_t(level_size[i].width), size_t(level_size[i].height)};
cv::gapi::ie::Params<cv::gapi::Generic> mtcnnp_net{
cv::gapi::ov::Params<cv::gapi::Generic> 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);
}

Expand Down
14 changes: 7 additions & 7 deletions demos/interactive_face_detection_demo/cpp_gapi/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <opencv2/gapi/gproto.hpp>
#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/infer/parsers.hpp>
#include <opencv2/gapi/streaming/format.hpp>
#include <opencv2/highgui.hpp>
Expand Down Expand Up @@ -469,7 +469,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<Faces>{
auto det_net = cv::gapi::ov::Params<Faces>{
FLAGS_m, // path to model
fileNameNoExt(FLAGS_m) + ".bin", // path to weights
FLAGS_d // device to use
Expand All @@ -478,7 +478,7 @@ int main(int argc, char* argv[]) {

// clang-format off
auto age_net =
cv::gapi::ie::Params<AgeGender>{
cv::gapi::ov::Params<AgeGender>{
FLAGS_mag, // path to model
fileNameNoExt(FLAGS_mag) + ".bin", // path to weights
FLAGS_dag // device to use
Expand All @@ -494,7 +494,7 @@ int main(int argc, char* argv[]) {

// clang-format off
auto hp_net =
cv::gapi::ie::Params<HeadPose>{
cv::gapi::ov::Params<HeadPose>{
FLAGS_mhp, // path to model
fileNameNoExt(FLAGS_mhp) + ".bin", // path to weights
FLAGS_dhp // device to use
Expand All @@ -510,7 +510,7 @@ int main(int argc, char* argv[]) {

// clang-format off
auto lm_net =
cv::gapi::ie::Params<FacialLandmark>{
cv::gapi::ov::Params<FacialLandmark>{
FLAGS_mlm, // path to model
fileNameNoExt(FLAGS_mlm) + ".bin", // path to weights
FLAGS_dlm // device to use
Expand All @@ -524,7 +524,7 @@ int main(int argc, char* argv[]) {
slog::info << "Facial Landmarks Estimation DISABLED." << slog::endl;
}

auto am_net = cv::gapi::ie::Params<ASpoof>{
auto am_net = cv::gapi::ov::Params<ASpoof>{
FLAGS_mam, // path to model
fileNameNoExt(FLAGS_mam) + ".bin", // path to weights
FLAGS_dam // device to use
Expand All @@ -535,7 +535,7 @@ int main(int argc, char* argv[]) {
slog::info << "Anti Spoof DISABLED." << slog::endl;
}

auto emo_net = cv::gapi::ie::Params<Emotions>{
auto emo_net = cv::gapi::ov::Params<Emotions>{
FLAGS_mem, // path to model
fileNameNoExt(FLAGS_mem) + ".bin", // path to weights
FLAGS_dem // device to use
Expand Down

0 comments on commit f1f7361

Please sign in to comment.