nareshmlx/opencv-pr huggingface dataset:
**File:** modules/gapi/src/backends/ov/govbackend.cpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,1001 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2023 Intel Corporation
+
+#include "precomp.hpp"
+
+// needs to be included regardless if IE is present or not
```

Review comment:
in fact it might be faster for "some" plugins to copy to pre-allocated buffer instead of creating another one over the `cv::Mat` memory without copy. The same for output - let plugin write to its own buffer and them copy from there. They way of how to set/get data from `openvino` can be the strategy... (worth to add TODO at least)
**File:** modules/gapi/include/opencv2/gapi/infer/ov.hpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,685 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2023 Intel Corporation
+
+#ifndef OPENCV_GAPI_INFER_OV_HPP
+#define OPENCV_GAPI_INFER_OV_HPP
+
```

Review comment:
This is the antipattern which grew organically the last time, but is there a chance to fix it now in the new code?
**File:** modules/gapi/misc/python/shadow_gapi.hpp
**Change Type:** modified
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -80,5 +80,6 @@ namespace detail
 {
     gapi::GNetParam GAPI_EXPORTS_W strip(gapi::ie::PyParams params);
     gapi::GNetParam GAPI_EXPORTS_W strip(gapi::onnx::PyParams params);
+    gapi::GNetParam GAPI_EXPORTS_W strip(gapi::ov::PyParams params);
 } // namespace detail
 } // namespace cv
```

Review comment:
unnecessary change
**File:** modules/gapi/test/infer/gapi_infer_ov_tests.cpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 81

**Code Changes:**
```diff
+
+struct AGNetGenComp {
+    static constexpr const char* tag = "age-gender-generic";
+    using Params = cv::gapi::ov::Params<cv::gapi::Generic>;
+
+    static Params params(const std::string &xml,
+                         const std::string &bin,
+                         const std::string &device) {
+        return {tag, xml, bin, device};
+    }
+
```

Review comment:
cosmetic, ignore so far
**File:** modules/gapi/src/backends/ov/govbackend.cpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,1001 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2023 Intel Corporation
+
+#include "precomp.hpp"
+
+// needs to be included regardless if IE is present or not
```

Review comment:
or spatial_size can be obtained from `tensor_layout` if such explicitly specified by user
**File:** modules/gapi/include/opencv2/gapi/infer/ov.hpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 44

**Code Changes:**
```diff
+// 2. Attr - value specified explicitly that should be broadcasted to all layers.
+// 3. AttrMap[str->T] - map specifies value for particular layer.
+template <typename Attr>
+using LayerVariantAttr = cv::util::variant< cv::util::monostate
+                                          , AttrMap<Attr>
+                                          , Attr>;
+
+struct ParamDesc {
+    struct Model {
+
+        Model(const std::string &model_path_,
```

Review comment:
The `Attr` case is for single in/out? the `AttrMap` is for many?
**File:** modules/gapi/include/opencv2/gapi/infer/ov.hpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,685 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2023 Intel Corporation
+
+#ifndef OPENCV_GAPI_INFER_OV_HPP
+#define OPENCV_GAPI_INFER_OV_HPP
+
```

Review comment:
This is pure duplication isn't it?
**File:** modules/gapi/misc/python/test/test_gapi_infer_ov.py
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,238 @@
+#!/usr/bin/env python
+
+import numpy as np
+import cv2 as cv
+import os
+import sys
+import unittest
+
+from tests_common import NewOpenCVTests
```

Review comment:
This comment is irrelevant to OV 2.0 update, but looking at this Python code I think.. Can't we avoid `GInferInputs` and in-place construct a dictionary ("name" -> "tensor") when running `infer()`? It would make code even less verbose.
**File:** modules/gapi/misc/python/test/test_gapi_infer_ov.py
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 195

**Code Changes:**
```diff
+            skip_if_openvino_not_available()
+
+            root_path  = '/omz_intel_models/intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013'
+            model_path = self.find_file(root_path + '.xml',   [os.environ.get('OPENCV_DNN_TEST_DATA_PATH')])
+            bin_path   = self.find_file(root_path + '.bin',   [os.environ.get('OPENCV_DNN_TEST_DATA_PATH')])
+            device_id  = 'CPU'
+
+            img_path = self.find_file('cv/face/david2.jpg', [os.environ.get('OPENCV_TEST_DATA_PATH')])
+            img = cv.imread(img_path)
+            planar_img = np.transpose(img, (2, 0, 1))
+            planar_img = np.expand_dims(planar_img, 0)
```

Review comment:
Are fixtures available in python tests? This could be a fixture
**File:** modules/gapi/src/backends/ov/govbackend.cpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 95

**Code Changes:**
```diff
+static int toCV(const ov::element::Type &type) {
+    switch (type) {
+        case ov::element::u8:  return CV_8U;
+        case ov::element::f32: return CV_32F;
+        case ov::element::i32: return CV_32S;
+        case ov::element::i64: return CV_32S;
+        case ov::element::f16: return CV_16F;
+        default: GAPI_Error("OV Backend: Unsupported data type");
+    }
+    return -1;
+}
```

Review comment:
i64 -> 32s ? How does it work? shouldn't this become 32SC2?
**File:** modules/gapi/src/backends/ov/govbackend.cpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,1001 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2023 Intel Corporation
+
+#include "precomp.hpp"
+
+// needs to be included regardless if IE is present or not
```

Review comment:
Is this shared with the 1.0 version?
**File:** modules/gapi/src/backends/ov/govbackend.cpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,1001 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2023 Intel Corporation
+
+#include "precomp.hpp"
+
+// needs to be included regardless if IE is present or not
```

Review comment:
Probably we could reuse one even for ONNX RT backend, as it also supports multiple streams now
**File:** modules/gapi/src/backends/ov/govbackend.cpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 796

**Code Changes:**
```diff
+            }
+            result.emplace_back(std::move(outm));
+        }
+
+        return result;
+    }
+
+    static void run(std::shared_ptr<OVCallContext> ctx,
+                    cv::gimpl::ov::RequestPool     &reqPool) {
+        using namespace std::placeholders;
+        reqPool.getIdleRequest()->execute(
```

Review comment:
This is probably the largest `outMeta` I've ever seen. :)
**File:** modules/gapi/src/backends/ov/govbackend.cpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,1001 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2023 Intel Corporation
+
+#include "precomp.hpp"
+
+// needs to be included regardless if IE is present or not
```

Review comment:
Note it OpenCV namespaces don't increase the indent.
**File:** modules/gapi/test/infer/gapi_infer_ov_tests.cpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,540 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2023 Intel Corporation
+
+#ifdef HAVE_INF_ENGINE
+
+#include "../test_precomp.hpp"
```

Review comment:
Do you still need the old dir layout or we just need to update CI / opencv_extra?
**File:** modules/gapi/include/opencv2/gapi/infer/ov.hpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 44

**Code Changes:**
```diff
+// 2. Attr - value specified explicitly that should be broadcasted to all layers.
+// 3. AttrMap[str->T] - map specifies value for particular layer.
+template <typename Attr>
+using LayerVariantAttr = cv::util::variant< cv::util::monostate
+                                          , AttrMap<Attr>
+                                          , Attr>;
+
+struct ParamDesc {
+    struct Model {
+
+        Model(const std::string &model_path_,
```

Review comment:
`Attr` - attribute is applied for all layer without explicitly specifying the names `AttrMap` - map `layer_name` -> attribute value
**File:** modules/gapi/include/opencv2/gapi/infer/ov.hpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,685 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2023 Intel Corporation
+
+#ifndef OPENCV_GAPI_INFER_OV_HPP
+#define OPENCV_GAPI_INFER_OV_HPP
+
```

Review comment:
Well, it is, probably can't be wrapped to something
**File:** modules/gapi/misc/python/test/test_gapi_infer_ov.py
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,238 @@
+#!/usr/bin/env python
+
+import numpy as np
+import cv2 as cv
+import os
+import sys
+import unittest
+
+from tests_common import NewOpenCVTests
```

Review comment:
I'd say we must since it's much more convenient for user (not only python user)
**File:** modules/gapi/misc/python/test/test_gapi_infer_ov.py
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 195

**Code Changes:**
```diff
+            skip_if_openvino_not_available()
+
+            root_path  = '/omz_intel_models/intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013'
+            model_path = self.find_file(root_path + '.xml',   [os.environ.get('OPENCV_DNN_TEST_DATA_PATH')])
+            bin_path   = self.find_file(root_path + '.bin',   [os.environ.get('OPENCV_DNN_TEST_DATA_PATH')])
+            device_id  = 'CPU'
+
+            img_path = self.find_file('cv/face/david2.jpg', [os.environ.get('OPENCV_TEST_DATA_PATH')])
+            img = cv.imread(img_path)
+            planar_img = np.transpose(img, (2, 0, 1))
+            planar_img = np.expand_dims(planar_img, 0)
```

Review comment:
Agree, can be isolated. Let's if we have time to clean it up
**File:** modules/gapi/src/backends/ov/govbackend.cpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,1001 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2023 Intel Corporation
+
+#include "precomp.hpp"
+
+// needs to be included regardless if IE is present or not
```

Review comment:
It's good idea, I didn't try to do everything in this PR. Make sense to make it general when we start implementing this for onnx backend.
**File:** modules/gapi/src/backends/ov/govbackend.cpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 796

**Code Changes:**
```diff
+            }
+            result.emplace_back(std::move(outm));
+        }
+
+        return result;
+    }
+
+    static void run(std::shared_ptr<OVCallContext> ctx,
+                    cv::gimpl::ov::RequestPool     &reqPool) {
+        using namespace std::placeholders;
+        reqPool.getIdleRequest()->execute(
```

Review comment:
Oh yea, it shouldn't be in `outMeta` definitely
**File:** modules/gapi/test/infer/gapi_infer_ov_tests.cpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,540 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2023 Intel Corporation
+
+#ifdef HAVE_INF_ENGINE
+
+#include "../test_precomp.hpp"
```

Review comment:
Yes, as far as I know layout remains the same
**File:** modules/gapi/include/opencv2/gapi/infer/ov.hpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,685 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2023 Intel Corporation
+
+#ifndef OPENCV_GAPI_INFER_OV_HPP
+#define OPENCV_GAPI_INFER_OV_HPP
+
```

Review comment:
Can you please leave a TODO here? TODO seems the most reliable thing we could always find later.
**File:** modules/gapi/src/backends/ov/govbackend.cpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,1001 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2023 Intel Corporation
+
+#include "precomp.hpp"
+
+// needs to be included regardless if IE is present or not
```

Review comment:
Please leave a TODO comment so we get back to it in the future
**File:** modules/gapi/test/infer/gapi_infer_ov_tests.cpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,540 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2023 Intel Corporation
+
+#ifdef HAVE_INF_ENGINE
+
+#include "../test_precomp.hpp"
```

Review comment:
Remains the same where? We don't need the `#else` branch today, right?
**File:** modules/gapi/src/api/gmat.cpp
**Change Type:** modified
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 156

**Code Changes:**
```diff
 
-    os << "C" << desc.chan;
-    if (desc.planar) os << "p";
-    os << " ";
-    os << desc.size.width << "x" << desc.size.height;
+    if (desc.isND()) {
+        os << " [";
+        for (size_t i = 0; i < desc.dims.size() - 1; ++i) {
+            os << desc.dims[i] << "x";
+        }
+        os << desc.dims.back() << "]";
```

Review comment:
Well, usually it prints something like `CV_8UC-1 -1x-1` for ND
**File:** modules/gapi/src/backends/ov/govbackend.cpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,1001 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2023 Intel Corporation
+
+#include "precomp.hpp"
+
+// needs to be included regardless if IE is present or not
```

Review comment:
???? Must be copy-paste
**File:** modules/gapi/CMakeLists.txt
**Change Type:** modified
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 160

**Code Changes:**
```diff
@@ -156,6 +156,10 @@ set(gapi_srcs
     src/backends/ie/giebackend.cpp
     src/backends/ie/giebackend/giewrapper.cpp
 
+    # OV Backend. FIXME: should be included by CMake
+    # if and only if OV support is enabled
+    src/backends/ov/govbackend.cpp
+
     # ONNX backend
     src/backends/onnx/gonnxbackend.cpp
 
```

Review comment:
The file already includes `HAVE_INF_ENGINE` so do we need an extra check here?
**File:** modules/gapi/include/opencv2/gapi/infer/bindings_ov.hpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,128 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2023 Intel Corporation
+
+#ifndef OPENCV_GAPI_INFER_BINDINGS_OV_HPP
+#define OPENCV_GAPI_INFER_BINDINGS_OV_HPP
+
```

Review comment:
`// OPENCV_GAPI_INFER_BINDINGS_OV_HPP`
**File:** modules/gapi/include/opencv2/gapi/infer/ov.hpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 212

**Code Changes:**
```diff
+
+    /** @brief Specifies tensor layout for an input layer.
+
+    The function is used to set tensor layout for an input layer.
+
+    @param layout Tensor layout ("NCHW", "NWHC", etc)
+    will be applied to all input layers.
+    @return reference to this parameter structure.
+    */
+    Params<Net>& cfgInputTensorLayout(std::string layout) {
+        detail::getModelToSetAttrOrThrow(m_desc.kind, "input tensor layout")
```

Review comment:
Should we add an OV reference here and below regarding `"??HW"` ?
**File:** modules/gapi/include/opencv2/gapi/infer/ov.hpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend

**Code Changes:**
```diff
@@ -0,0 +1,685 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+//
+// Copyright (C) 2023 Intel Corporation
+
+#ifndef OPENCV_GAPI_INFER_OV_HPP
+#define OPENCV_GAPI_INFER_OV_HPP
+
```

Review comment:
`output layer`
**File:** modules/gapi/include/opencv2/gapi/infer/ov.hpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 439

**Code Changes:**
```diff
+
+    @param interpolation Resize interpolation algorithm.
+    Supported algorithms: #INTER_NEAREST, #INTER_LINEAR, #INTER_CUBIC.
+    @return reference to this parameter structure.
+    */
+    Params<Net>& cfgResize(int interpolation) {
+        detail::getModelToSetAttrOrThrow(m_desc.kind, "resize preprocessing")
+            .interpolation = std::move(interpolation);
+        return *this;
+    }
+
```

Review comment:
Should we add a default value here?
**File:** modules/gapi/include/opencv2/gapi/infer/ov.hpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 522

**Code Changes:**
```diff
+                , 0u
+                , 0u) {
+    }
+
+    /** @see ov::Params::cfgPluginConfig. */
+    Params& cfgPluginConfig(const detail::ParamDesc::PluginConfigT &config) {
+        m_desc.config = config;
+        return *this;
+    }
+
+    /** @see ov::Params::cfgInputTensorLayout. */
```

Review comment:
Wow, is there a way to avoid copy-paste for generic params?
**File:** modules/gapi/include/opencv2/gapi/infer/ov.hpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 522

**Code Changes:**
```diff
+                , 0u
+                , 0u) {
+    }
+
+    /** @see ov::Params::cfgPluginConfig. */
+    Params& cfgPluginConfig(const detail::ParamDesc::PluginConfigT &config) {
+        m_desc.config = config;
+        return *this;
+    }
+
+    /** @see ov::Params::cfgInputTensorLayout. */
```

Review comment:
I didn't find, template specialization or inheritance won't work there because it returns `Params&`
**File:** modules/gapi/include/opencv2/gapi/infer/ov.hpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 439

**Code Changes:**
```diff
+
+    @param interpolation Resize interpolation algorithm.
+    Supported algorithms: #INTER_NEAREST, #INTER_LINEAR, #INTER_CUBIC.
+    @return reference to this parameter structure.
+    */
+    Params<Net>& cfgResize(int interpolation) {
+        detail::getModelToSetAttrOrThrow(m_desc.kind, "resize preprocessing")
+            .interpolation = std::move(interpolation);
+        return *this;
+    }
+
```

Review comment:
Well, probably but then there won't be any default value for `map` case?
**File:** modules/gapi/misc/python/test/test_gapi_infer_ov.py
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 89

**Code Changes:**
```diff
+
+        def test_age_gender_infer_image(self):
+            skip_if_openvino_not_available()
+
+            root_path  = '/omz_intel_models/intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013'
+            model_path = self.find_file(root_path + '.xml',   [os.environ.get('OPENCV_DNN_TEST_DATA_PATH')])
+            bin_path   = self.find_file(root_path + '.bin',   [os.environ.get('OPENCV_DNN_TEST_DATA_PATH')])
+            device_id  = 'CPU'
+
+            img_path = self.find_file('cv/face/david2.jpg', [os.environ.get('OPENCV_TEST_DATA_PATH')])
+            img = cv.imread(img_path)
```

Review comment:
Could we utilize other models here? E.g. `.onnx`?
**File:** modules/gapi/include/opencv2/gapi/infer/ov.hpp
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 212

**Code Changes:**
```diff
+
+    /** @brief Specifies tensor layout for an input layer.
+
+    The function is used to set tensor layout for an input layer.
+
+    @param layout Tensor layout ("NCHW", "NWHC", etc)
+    will be applied to all input layers.
+    @return reference to this parameter structure.
+    */
+    Params<Net>& cfgInputTensorLayout(std::string layout) {
+        detail::getModelToSetAttrOrThrow(m_desc.kind, "input tensor layout")
```

Review comment:
I wouldn't add besides this layout may trigger `assert`. See `govbackend` for the details
**File:** modules/gapi/misc/python/test/test_gapi_infer_ov.py
**Change Type:** added
**Context:** PR #23595: [G-API] Implement OpenVINO 2.0 backend
**Review Line:** 221

**Code Changes:**
```diff
+            gapi_age, gapi_gender = comp.apply(planar_img)
+
+            # Check
+            self.assertEqual(0.0, cv.norm(ov_gender, gapi_gender, cv.NORM_INF))
+            self.assertEqual(0.0, cv.norm(ov_age, gapi_age, cv.NORM_INF))
+
+
+except unittest.SkipTest as e:
+
+    message = str(e)
+
```

Review comment:
What about testing invalid cases? Where we get G-API or OV throwing an exception