nareshmlx/opencv-pr huggingface dataset:
**File:** modules/gapi/include/opencv2/gapi/infer/onnx.hpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -58,6 +58,8 @@ struct ParamDesc {
     PostProc custom_post_proc;
 
     std::vector<bool> normalize;
+
+    std::vector<std::string> names_to_remap;
 };
 } // namespace detail
 
@@ -115,13 +117,70 @@ template<typename Net> class Params {
```

Review comment:
`out_metas` ? `outs` is confusing.
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs
**Review Line:** 799

**Code Changes:**
```diff
         });
     GAPI_Assert(it != info.end());
@@ -797,9 +797,12 @@ void ONNXCompiled::Run(const std::vector<cv::Mat>& ins,
         // Hard path - run session & user-defined post-processing
         // NOTE: use another list of output names here
         std::vector<const char*> out_names;
-        for (auto &&ti : out_tensor_info) {
-            out_names.push_back(ti.name.c_str());
-        }
+        out_names.reserve(outs.size());
+        params.names_to_remap.empty()
```

Review comment:
Why not `std::string` ?
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -47,7 +47,7 @@ struct TensorInfo {
     explicit TensorInfo(const Ort::TensorTypeAndShapeInfo& info)
         : dims(info.GetShape())
         , type(info.GetElementType())
-        , is_dynamic(std::find(dims.begin(), dims.end(), -1) != dims.end()) {
+        , is_dynamic(ade::util::find(dims, -1) != dims.end()) {
 
         // Double-check if the tensor is really dynamic
         // Allow N to be -1
@@ -158,7 +158,7 @@ inline std::vector<const char*> getCharNames(const std::vector<std::string>& nam
```

Review comment:
Think about how to remove code duplication, btw you don't need to use loop in there.
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
`remapRCNNPorts`
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -47,7 +47,7 @@ struct TensorInfo {
     explicit TensorInfo(const Ort::TensorTypeAndShapeInfo& info)
         : dims(info.GetShape())
         , type(info.GetElementType())
-        , is_dynamic(std::find(dims.begin(), dims.end(), -1) != dims.end()) {
+        , is_dynamic(ade::util::find(dims, -1) != dims.end()) {
 
         // Double-check if the tensor is really dynamic
         // Allow N to be -1
@@ -158,7 +158,7 @@ inline std::vector<const char*> getCharNames(const std::vector<std::string>& nam
```

Review comment:
`ade::util::transform` ?
**File:** modules/gapi/include/opencv2/gapi/infer/onnx.hpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -58,6 +58,8 @@ struct ParamDesc {
     PostProc custom_post_proc;
 
     std::vector<bool> normalize;
+
+    std::vector<std::string> names_to_remap;
 };
 } // namespace detail
 
@@ -115,13 +117,70 @@ template<typename Net> class Params {
```

Review comment:
`desc.names_to_remap = names_to_remap`, or something like this looks clearer
**File:** modules/gapi/include/opencv2/gapi/infer/onnx.hpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -58,6 +58,8 @@ struct ParamDesc {
     PostProc custom_post_proc;
 
     std::vector<bool> normalize;
+
+    std::vector<std::string> names_to_remap;
 };
 } // namespace detail
 
@@ -115,13 +117,70 @@ template<typename Net> class Params {
```

Review comment:
in most of cases we have `&&` as an input. Does it make sense to support this case separately
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -47,7 +47,7 @@ struct TensorInfo {
     explicit TensorInfo(const Ort::TensorTypeAndShapeInfo& info)
         : dims(info.GetShape())
         , type(info.GetElementType())
-        , is_dynamic(std::find(dims.begin(), dims.end(), -1) != dims.end()) {
+        , is_dynamic(ade::util::find(dims, -1) != dims.end()) {
 
         // Double-check if the tensor is really dynamic
         // Allow N to be -1
@@ -158,7 +158,7 @@ inline std::vector<const char*> getCharNames(const std::vector<std::string>& nam
```

Review comment:
Is it possible to merge this condition with the above one
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -47,7 +47,7 @@ struct TensorInfo {
     explicit TensorInfo(const Ort::TensorTypeAndShapeInfo& info)
         : dims(info.GetShape())
         , type(info.GetElementType())
-        , is_dynamic(std::find(dims.begin(), dims.end(), -1) != dims.end()) {
+        , is_dynamic(ade::util::find(dims, -1) != dims.end()) {
 
         // Double-check if the tensor is really dynamic
         // Allow N to be -1
@@ -158,7 +158,7 @@ inline std::vector<const char*> getCharNames(const std::vector<std::string>& nam
```

Review comment:
In `toCV` function int64->int32 can be done (but let's do it later)
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -47,7 +47,7 @@ struct TensorInfo {
     explicit TensorInfo(const Ort::TensorTypeAndShapeInfo& info)
         : dims(info.GetShape())
         , type(info.GetElementType())
-        , is_dynamic(std::find(dims.begin(), dims.end(), -1) != dims.end()) {
+        , is_dynamic(ade::util::find(dims, -1) != dims.end()) {
 
         // Double-check if the tensor is really dynamic
         // Allow N to be -1
@@ -158,7 +158,7 @@ inline std::vector<const char*> getCharNames(const std::vector<std::string>& nam
```

Review comment:
Added ade::util::transform. +-. I wanted to use one std::transform, but names_to_remap and out_tensor_info can have different sizes.
**File:** modules/gapi/include/opencv2/gapi/infer/onnx.hpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -58,6 +58,8 @@ struct ParamDesc {
     PostProc custom_post_proc;
 
     std::vector<bool> normalize;
+
+    std::vector<std::string> names_to_remap;
 };
 } // namespace detail
 
@@ -115,13 +117,70 @@ template<typename Net> class Params {
```

Review comment:
Added overloads.
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -47,7 +47,7 @@ struct TensorInfo {
     explicit TensorInfo(const Ort::TensorTypeAndShapeInfo& info)
         : dims(info.GetShape())
         , type(info.GetElementType())
-        , is_dynamic(std::find(dims.begin(), dims.end(), -1) != dims.end()) {
+        , is_dynamic(ade::util::find(dims, -1) != dims.end()) {
 
         // Double-check if the tensor is really dynamic
         // Allow N to be -1
@@ -158,7 +158,7 @@ inline std::vector<const char*> getCharNames(const std::vector<std::string>& nam
```

Review comment:
`names_to_remap.size()` can be greater than `out_tensor_info.size()` ?
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
Just wondering why not `cv::Mat::copyTo` ?
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
`emplace_back` ?
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs
**Review Line:** 366

**Code Changes:**
```diff
-            char* out_node_name_p = session.GetOutputName(i, allocator);
-            out_node_names.push_back(std::string(out_node_name_p));
-            allocator.Free(out_node_name_p);
+        if (custom_out_names.empty()) {
+            for(size_t i = 0; i < num_out; ++i) {
+                char* out_node_name_p = session.GetOutputName(i, allocator);
+                out_node_names.emplace_back(out_node_name_p);
+                allocator.Free(out_node_name_p);
+            }
+        } else {
+            out_node_names = std::move(custom_out_names);
```

Review comment:
Why not `const char*`
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs
**Review Line:** 374

**Code Changes:**
```diff
+            }
+        } else {
+            out_node_names = std::move(custom_out_names);
         }
         // Input/output order by names
         const auto in_run_names  = getCharNames(in_node_names);
         const auto out_run_names = getCharNames(out_node_names);
+        num_out = out_run_names.size();
         // Run
         auto result = session.Run(Ort::RunOptions{nullptr},
                                   in_run_names.data(),
```

Review comment:
BTW, it can be `transform` inside
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
`out_node_names = custom_out_names` It would be perfect to avoid copy here, but I'm not sure that it's possible in current implementation
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
Can the disable output feature works without remap function ? I would reflect it in tests.
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -47,7 +47,7 @@ struct TensorInfo {
     explicit TensorInfo(const Ort::TensorTypeAndShapeInfo& info)
         : dims(info.GetShape())
         , type(info.GetElementType())
-        , is_dynamic(std::find(dims.begin(), dims.end(), -1) != dims.end()) {
+        , is_dynamic(ade::util::find(dims, -1) != dims.end()) {
 
         // Double-check if the tensor is really dynamic
         // Allow N to be -1
@@ -158,7 +158,7 @@ inline std::vector<const char*> getCharNames(const std::vector<std::string>& nam
```

Review comment:
Yes. `out_tensor_info` is based on network parameters. `names_to_remap`'s size can be 1, when CNN has 3 outputs.
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
Possible reallocation. `copyToOut` function avoids this.
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs
**Review Line:** 366

**Code Changes:**
```diff
-            char* out_node_name_p = session.GetOutputName(i, allocator);
-            out_node_names.push_back(std::string(out_node_name_p));
-            allocator.Free(out_node_name_p);
+        if (custom_out_names.empty()) {
+            for(size_t i = 0; i < num_out; ++i) {
+                char* out_node_name_p = session.GetOutputName(i, allocator);
+                out_node_names.emplace_back(out_node_name_p);
+                allocator.Free(out_node_name_p);
+            }
+        } else {
+            out_node_names = std::move(custom_out_names);
```

Review comment:
ONNXRuntime legacy.(
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs
**Review Line:** 374

**Code Changes:**
```diff
+            }
+        } else {
+            out_node_names = std::move(custom_out_names);
         }
         // Input/output order by names
         const auto in_run_names  = getCharNames(in_node_names);
         const auto out_run_names = getCharNames(out_node_names);
+        num_out = out_run_names.size();
         // Run
         auto result = session.Run(Ort::RunOptions{nullptr},
                                   in_run_names.data(),
```

Review comment:
Added transform to `getCharNames`.
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
Is it critical? This fixture is Frankenstein, that support all ORT session.Run functional.
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
No. `disable output` works for dynamic outputs case. Nets with static outputs don't use remap function. But if you try use net with dynamic outputs without remap function then you receive error message about it.
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
Added std::move for `custom_out_names`. `custom_out_names` - rvalue parameter.
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
alignment is broken. BTW the name doesn't reflect the meaning (`reallocation`)
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
Changed name. Fixed alignment.
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
Added validation for reallocation.
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
I believe `c_str` is more correct than `data`
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
The question remains, why not `in_boxes.copyTo(out_boxes)` ?
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
Need end data mark for some tests. It is for case, when we set size of graph output which bigger than onnx out.
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
`std::copy_n`
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
Put the comment about this logic
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
std::copy, because per byte validation was removed after discussion.
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -47,7 +47,7 @@ struct TensorInfo {
     explicit TensorInfo(const Ort::TensorTypeAndShapeInfo& info)
         : dims(info.GetShape())
         , type(info.GetElementType())
-        , is_dynamic(std::find(dims.begin(), dims.end(), -1) != dims.end()) {
+        , is_dynamic(ade::util::find(dims, -1) != dims.end()) {
 
         // Double-check if the tensor is really dynamic
         // Allow N to be -1
@@ -158,7 +158,7 @@ inline std::vector<const char*> getCharNames(const std::vector<std::string>& nam
```

Review comment:
Does it make sense to put information that it happened in `ONNX` backend ?
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
What's the reason of using `static_cast` ? end_mark and gptr has the same type
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -47,7 +47,7 @@ struct TensorInfo {
     explicit TensorInfo(const Ort::TensorTypeAndShapeInfo& info)
         : dims(info.GetShape())
         , type(info.GetElementType())
-        , is_dynamic(std::find(dims.begin(), dims.end(), -1) != dims.end()) {
+        , is_dynamic(ade::util::find(dims, -1) != dims.end()) {
 
         // Double-check if the tensor is really dynamic
         // Allow N to be -1
@@ -158,7 +158,7 @@ inline std::vector<const char*> getCharNames(const std::vector<std::string>& nam
```

Review comment:
Changed message. Added mention about ONNX.
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
No sense. Fixed.
**File:** modules/gapi/include/opencv2/gapi/infer/onnx.hpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs
**Review Line:** 150

**Code Changes:**
```diff
+    Params<Net>& cfgPostProc(std::vector<cv::GMatDesc> &&out_metas,
+                             PostProc &&pp) {
+        desc.out_metas        = std::move(out_metas);
+        desc.custom_post_proc = std::move(pp);
+        return *this;
+    }
+
+    /** @overload
+    The function has additional parameter names_to_remap. This parameter provides
+    information about output layers which will be used for infer and in post
+    processing function.
```

Review comment:
I believe doxygen comments are really missing here since the semantics of these methods is not very trivial
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18903: G-API: ONNX. Disable unnecessary outputs

**Code Changes:**
```diff
@@ -9,10 +9,11 @@
 #ifdef HAVE_ONNX
 
 #include <stdexcept>
-#include <onnxruntime_cxx_api.h>
-#include <ade/util/iota_range.hpp>
 #include <codecvt> // wstring_convert
 
+#include <onnxruntime_cxx_api.h>
+#include <ade/util/iota_range.hpp>
```

Review comment:
`to divide`, but divide is usually about math and I'd recommend to use "separate"