nareshmlx/opencv-pr huggingface dataset:
**File:** modules/gapi/src/backends/fluid/gfluidcore.cpp
**Change Type:** modified
**Context:** PR #18466: GAPI: SIMD optimization for AddWeighted kernel. - SIMD optimization for AddWeighted kernel via universal intrinsics. <cut/> ``` force_build...

**Code Changes:**
```diff
@@ -97,6 +97,130 @@ static inline DST divr(SRC1 x, SRC2 y, float scale=1)
 // Fluid kernels: addWeighted
 //
 //---------------------------
+#if CV_SSE2
+CV_ALWAYS_INLINE v_float32 v_load_f32(const ushort* in)
+{
+    return v_cvt_f32(v_reinterpret_as_s32(vx_load_expand(in)));
+}
+
```

Review comment:
This check isn't necessary IMO. Internal defines implies CV_SIMD and probably ensure !CV_NEON. Moreover I don't see any reason to restrict NEON capable platform if it by some reason supports AVX
**File:** modules/gapi/src/backends/fluid/gfluidcore.cpp
**Change Type:** modified
**Context:** PR #18466: GAPI: SIMD optimization for AddWeighted kernel. - SIMD optimization for AddWeighted kernel via universal intrinsics. <cut/> ``` force_build...

**Code Changes:**
```diff
@@ -97,6 +97,130 @@ static inline DST divr(SRC1 x, SRC2 y, float scale=1)
 // Fluid kernels: addWeighted
 //
 //---------------------------
+#if CV_SSE2
+CV_ALWAYS_INLINE v_float32 v_load_f32(const ushort* in)
+{
+    return v_cvt_f32(v_reinterpret_as_s32(vx_load_expand(in)));
+}
+
```

Review comment:
It would be better to check for `CV_SSE2` rather than `!CV_NEON`. Otherwise compilation could be failed for PowerPC or WebAssembly. Other option is to redefine `v_cvt_f32(v_uint32)` as `v_cvt_f32(v_reinterpret_as_s32())`
**File:** modules/gapi/src/backends/fluid/gfluidcore.cpp
**Change Type:** modified
**Context:** PR #18466: GAPI: SIMD optimization for AddWeighted kernel. - SIMD optimization for AddWeighted kernel via universal intrinsics. <cut/> ``` force_build...

**Code Changes:**
```diff
@@ -97,6 +97,130 @@ static inline DST divr(SRC1 x, SRC2 y, float scale=1)
 // Fluid kernels: addWeighted
 //
 //---------------------------
+#if CV_SSE2
+CV_ALWAYS_INLINE v_float32 v_load_f32(const ushort* in)
+{
+    return v_cvt_f32(v_reinterpret_as_s32(vx_load_expand(in)));
+}
+
```

Review comment:
CV_SIMD includes all types SIMD optimization such as: CV_SSE2, CV_AVX2, CV_AVX512 and CV_NEON. Since this SIMD opt don't give speed-up for ARM NEON, there are necessity to disable it for ARM NEON case.
**File:** modules/gapi/src/backends/fluid/gfluidcore.cpp
**Change Type:** modified
**Context:** PR #18466: GAPI: SIMD optimization for AddWeighted kernel. - SIMD optimization for AddWeighted kernel via universal intrinsics. <cut/> ``` force_build...

**Code Changes:**
```diff
@@ -97,6 +97,130 @@ static inline DST divr(SRC1 x, SRC2 y, float scale=1)
 // Fluid kernels: addWeighted
 //
 //---------------------------
+#if CV_SSE2
+CV_ALWAYS_INLINE v_float32 v_load_f32(const ushort* in)
+{
+    return v_cvt_f32(v_reinterpret_as_s32(vx_load_expand(in)));
+}
+
```

Review comment:
> Why do we need this? Why does `v_load()` not work? Outdated.
**File:** modules/gapi/src/backends/fluid/gfluidcore.cpp
**Change Type:** modified
**Context:** PR #18466: GAPI: SIMD optimization for AddWeighted kernel. - SIMD optimization for AddWeighted kernel via universal intrinsics. <cut/> ``` force_build...

**Code Changes:**
```diff
@@ -97,6 +97,130 @@ static inline DST divr(SRC1 x, SRC2 y, float scale=1)
 // Fluid kernels: addWeighted
 //
 //---------------------------
+#if CV_SSE2
+CV_ALWAYS_INLINE v_float32 v_load_f32(const ushort* in)
+{
+    return v_cvt_f32(v_reinterpret_as_s32(vx_load_expand(in)));
+}
+
```

Review comment:
Why need changes: I don't like these `reinterpret_cast`s. I hope you agree I think it will be better just to use overloaded function `v_load_f32` for every `SRC` type, not the template. Or, mb it is important to preserve the `CV_Error`; in that case preserve _template_'ness but specialize it instead of `else if`. The `Error` can be placed in the non-specialized version. Smth like that: ``` template<typename SRC> inline v_float32 v_load_f32(const SRC* ptr) { CV_Error(cv::Error::StsBadArg, "unsupported type"); return %smth_default%; // Should this function have return or not?.. } template<> inline v_float32 v_load_f32<uchar>(const uchar* ptr) { v_uint32 tmp = vx_load_expand_q(ptr); return v_cvt_f32(v_reinterpret_as_s32(tmp)); } ... ```
**File:** modules/gapi/src/backends/fluid/gfluidcore.cpp
**Change Type:** modified
**Context:** PR #18466: GAPI: SIMD optimization for AddWeighted kernel. - SIMD optimization for AddWeighted kernel via universal intrinsics. <cut/> ``` force_build...

**Code Changes:**
```diff
@@ -97,6 +97,130 @@ static inline DST divr(SRC1 x, SRC2 y, float scale=1)
 // Fluid kernels: addWeighted
 //
 //---------------------------
+#if CV_SSE2
+CV_ALWAYS_INLINE v_float32 v_load_f32(const ushort* in)
+{
+    return v_cvt_f32(v_reinterpret_as_s32(vx_load_expand(in)));
+}
+
```

Review comment:
This proposal couldn't to be implemented because of there isn't capabilities.
**File:** modules/gapi/src/backends/fluid/gfluidcore.cpp
**Change Type:** modified
**Context:** PR #18466: GAPI: SIMD optimization for AddWeighted kernel. - SIMD optimization for AddWeighted kernel via universal intrinsics. <cut/> ``` force_build...

**Code Changes:**
```diff
@@ -97,6 +97,130 @@ static inline DST divr(SRC1 x, SRC2 y, float scale=1)
 // Fluid kernels: addWeighted
 //
 //---------------------------
+#if CV_SSE2
+CV_ALWAYS_INLINE v_float32 v_load_f32(const ushort* in)
+{
+    return v_cvt_f32(v_reinterpret_as_s32(vx_load_expand(in)));
+}
+
```

Review comment:
If there are no noticeable regressions, then it make sense do not exclude NEON here.
**File:** modules/gapi/src/backends/fluid/gfluidcore.cpp
**Change Type:** modified
**Context:** PR #18466: GAPI: SIMD optimization for AddWeighted kernel. - SIMD optimization for AddWeighted kernel via universal intrinsics. <cut/> ``` force_build...

**Code Changes:**
```diff
@@ -97,6 +97,130 @@ static inline DST divr(SRC1 x, SRC2 y, float scale=1)
 // Fluid kernels: addWeighted
 //
 //---------------------------
+#if CV_SSE2
+CV_ALWAYS_INLINE v_float32 v_load_f32(const ushort* in)
+{
+    return v_cvt_f32(v_reinterpret_as_s32(vx_load_expand(in)));
+}
+
```

Review comment:
The point is that ARM is our target platform for optimization, so I can't reduce its performance even by a percent. Moreover, the decrease in performance is up to 15% on some test cases. Performance report is here: [AddWeighted_neon_perf_report.xlsx](https://github.com/opencv/opencv/files/5886985/AddWeighted_neon_perf_report.xlsx)
**File:** modules/gapi/src/backends/fluid/gfluidcore.cpp
**Change Type:** modified
**Context:** PR #18466: GAPI: SIMD optimization for AddWeighted kernel. - SIMD optimization for AddWeighted kernel via universal intrinsics. <cut/> ``` force_build...

**Code Changes:**
```diff
@@ -97,6 +97,130 @@ static inline DST divr(SRC1 x, SRC2 y, float scale=1)
 // Fluid kernels: addWeighted
 //
 //---------------------------
+#if CV_SSE2
+CV_ALWAYS_INLINE v_float32 v_load_f32(const ushort* in)
+{
+    return v_cvt_f32(v_reinterpret_as_s32(vx_load_expand(in)));
+}
+
```

Review comment:
Why? I don't know any case where passing SIMD vectors through parameters (into non-inline function) can improve performance.
**File:** modules/gapi/src/backends/fluid/gfluidcore.cpp
**Change Type:** modified
**Context:** PR #18466: GAPI: SIMD optimization for AddWeighted kernel. - SIMD optimization for AddWeighted kernel via universal intrinsics. <cut/> ``` force_build...

**Code Changes:**
```diff
@@ -97,6 +97,130 @@ static inline DST divr(SRC1 x, SRC2 y, float scale=1)
 // Fluid kernels: addWeighted
 //
 //---------------------------
+#if CV_SSE2
+CV_ALWAYS_INLINE v_float32 v_load_f32(const ushort* in)
+{
+    return v_cvt_f32(v_reinterpret_as_s32(vx_load_expand(in)));
+}
+
```

Review comment:
Functions `addw_short2uchar()`, `addw_short2short()` were renamed to `addw_simd()` and became templated with 2 template specializations. Please don't rely on github's diff. It often shows a difference incorrectly. Since showed above intermediate function was removed, initialization of vectors alpha, beta, gamma had to be moved to function `run_addweighted()` on one call stack's level higher.
**File:** modules/gapi/src/backends/fluid/gfluidcore.cpp
**Change Type:** modified
**Context:** PR #18466: GAPI: SIMD optimization for AddWeighted kernel. - SIMD optimization for AddWeighted kernel via universal intrinsics. <cut/> ``` force_build...

**Code Changes:**
```diff
@@ -97,6 +97,130 @@ static inline DST divr(SRC1 x, SRC2 y, float scale=1)
 // Fluid kernels: addWeighted
 //
 //---------------------------
+#if CV_SSE2
+CV_ALWAYS_INLINE v_float32 v_load_f32(const ushort* in)
+{
+    return v_cvt_f32(v_reinterpret_as_s32(vx_load_expand(in)));
+}
+
```

Review comment:
So now `addw_simd()` look like this: ``` template<typename SRC, typename DST> CV_ALWAYS_INLINE int addw_simd(const SRC in1[], const SRC in2[], DST out[], const v_float32& alpha, const v_float32& beta, const v_float32& gamma, int length) { GAPI_Assert((std::is_same<DST, ushort>::value) || (std::is_same<DST, short>::value)); constexpr int nlanes = (std::is_same<DST, ushort>::value) ? static_cast<int>(v_uint16::nlanes) : static_cast<int>(v_int16::nlanes); if (length < nlanes) return 0; int x = 0; for (;;) { for (; x <= length - nlanes; x += nlanes) { v_float32 a1 = v_load_f32(&in1[x]); v_float32 a2 = v_load_f32(&in1[x + nlanes / 2]); v_float32 b1 = v_load_f32(&in2[x]); v_float32 b2 = v_load_f32(&in2[x + nlanes / 2]); addw_short_store(&out[x], v_round(v_fma(a1, alpha, v_fma(b1, beta, gamma))), v_round(v_fma(a2, alpha, v_fma(b2, beta, gamma)))); } if (x < length) { x = length - nlanes; continue; // process one more time (unaligned tail) } break; } return x; } template<typename SRC> CV_ALWAYS_INLINE int addw_simd(const SRC in1[], const SRC in2[], uchar out[], const v_float32& alpha, const v_float32& beta, const v_float32& gamma, int length) { constexpr int nlanes = v_uint8::nlanes; if (length < nlanes) return 0; int x = 0; for (;;) { for (; x <= length - nlanes; x += nlanes) { v_float32 a1 = v_load_f32(&in1[x]); v_float32 a2 = v_load_f32(&in1[x + nlanes / 4]); v_float32 a3 = v_load_f32(&in1[x + nlanes / 2]); v_float32 a4 = v_load_f32(&in1[x + 3 * nlanes / 4]); v_float32 b1 = v_load_f32(&in2[x]); v_float32 b2 = v_load_f32(&in2[x + nlanes / 4]); v_float32 b3 = v_load_f32(&in2[x + nlanes / 2]); v_float32 b4 = v_load_f32(&in2[x + 3 * nlanes / 4]); v_int32 sum1 = v_round(v_fma(a1, alpha, v_fma(b1, beta, gamma))), sum2 = v_round(v_fma(a2, alpha, v_fma(b2, beta, gamma))), sum3 = v_round(v_fma(a3, alpha, v_fma(b3, beta, gamma))), sum4 = v_round(v_fma(a4, alpha, v_fma(b4, beta, gamma))); vx_store(&out[x], v_pack_u(v_pack(sum1, sum2), v_pack(sum3, sum4))); } if (x < length) { x = length - nlanes; continue; // process one more time (unaligned tail) } break; } return x; } template<typename SRC> CV_ALWAYS_INLINE int addw_simd(const SRC*, const SRC*, float*, const v_float32&, const v_float32&, const v_float32&, int length) { //Cases when dst type is float are successfully vectorized with compiler. return 0; } ```
**File:** modules/gapi/src/backends/fluid/gfluidcore.cpp
**Change Type:** modified
**Context:** PR #18466: GAPI: SIMD optimization for AddWeighted kernel. - SIMD optimization for AddWeighted kernel via universal intrinsics. <cut/> ``` force_build...

**Code Changes:**
```diff
@@ -97,6 +97,130 @@ static inline DST divr(SRC1 x, SRC2 y, float scale=1)
 // Fluid kernels: addWeighted
 //
 //---------------------------
+#if CV_SSE2
+CV_ALWAYS_INLINE v_float32 v_load_f32(const ushort* in)
+{
+    return v_cvt_f32(v_reinterpret_as_s32(vx_load_expand(in)));
+}
+
```

Review comment:
But if you mind I can move ``` v_float32 a = vx_setall_f32(_alpha); v_float32 b = vx_setall_f32(_beta); v_float32 g = vx_setall_f32(_gamma); ``` to each of the `addw_simd()` template specialization. But it cause code duplication.
**File:** modules/gapi/src/backends/fluid/gfluidcore.cpp
**Change Type:** modified
**Context:** PR #18466: GAPI: SIMD optimization for AddWeighted kernel. - SIMD optimization for AddWeighted kernel via universal intrinsics. <cut/> ``` force_build...

**Code Changes:**
```diff
@@ -97,6 +97,130 @@ static inline DST divr(SRC1 x, SRC2 y, float scale=1)
 // Fluid kernels: addWeighted
 //
 //---------------------------
+#if CV_SSE2
+CV_ALWAYS_INLINE v_float32 v_load_f32(const ushort* in)
+{
+    return v_cvt_f32(v_reinterpret_as_s32(vx_load_expand(in)));
+}
+
```

Review comment:
> `GAPI_Assert((std::is_same<DST, ushort>::value) || (std::is_same<DST, short>::value));` C++ way is using `std::enable_if` (SFINAE).
**File:** modules/gapi/src/backends/fluid/gfluidcore.cpp
**Change Type:** modified
**Context:** PR #18466: GAPI: SIMD optimization for AddWeighted kernel. - SIMD optimization for AddWeighted kernel via universal intrinsics. <cut/> ``` force_build...

**Code Changes:**
```diff
@@ -97,6 +97,130 @@ static inline DST divr(SRC1 x, SRC2 y, float scale=1)
 // Fluid kernels: addWeighted
 //
 //---------------------------
+#if CV_SSE2
+CV_ALWAYS_INLINE v_float32 v_load_f32(const ushort* in)
+{
+    return v_cvt_f32(v_reinterpret_as_s32(vx_load_expand(in)));
+}
+
```

Review comment:
> > `GAPI_Assert((std::is_same<DST, ushort>::value) || (std::is_same<DST, short>::value));` > > C++ way is using `std::enable_if` (SFINAE). I'm confused a little. Could you please give an example how I can apply `std::enable_if` for this case?
**File:** modules/gapi/src/backends/fluid/gfluidcore.cpp
**Change Type:** modified
**Context:** PR #18466: GAPI: SIMD optimization for AddWeighted kernel. - SIMD optimization for AddWeighted kernel via universal intrinsics. <cut/> ``` force_build...

**Code Changes:**
```diff
@@ -97,6 +97,130 @@ static inline DST divr(SRC1 x, SRC2 y, float scale=1)
 // Fluid kernels: addWeighted
 //
 //---------------------------
+#if CV_SSE2
+CV_ALWAYS_INLINE v_float32 v_load_f32(const ushort* in)
+{
+    return v_cvt_f32(v_reinterpret_as_s32(vx_load_expand(in)));
+}
+
```

Review comment:
> #if CV_SSE2 | CV_AVX2 | CV_AVX512_SKX Why is just `#if CV_SSE2` not enough?
**File:** modules/gapi/src/backends/fluid/gfluidcore.cpp
**Change Type:** modified
**Context:** PR #18466: GAPI: SIMD optimization for AddWeighted kernel. - SIMD optimization for AddWeighted kernel via universal intrinsics. <cut/> ``` force_build...

**Code Changes:**
```diff
@@ -97,6 +97,130 @@ static inline DST divr(SRC1 x, SRC2 y, float scale=1)
 // Fluid kernels: addWeighted
 //
 //---------------------------
+#if CV_SSE2
+CV_ALWAYS_INLINE v_float32 v_load_f32(const ushort* in)
+{
+    return v_cvt_f32(v_reinterpret_as_s32(vx_load_expand(in)));
+}
+
```

Review comment:
> if you mind I can move This should be moved into SIMD functions. Think about runtime dispatching (not in a scope of this PR) where we don't even know SIMD size and registers types of underlying functions. Which SIMD value do you want to send there? --- Consider following these rules: - no SIMD variables in dispatching code (generic C++ part) - no SIMD arguments in SIMD functions which are called from generic C++ code.
**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:
What if a user gives one name multiple times accidentally?
**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:
Isn't it always true? It's just after condition
**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:
You can use `num_out` here, I suppose? The string [:200](https://github.com/opencv/opencv/pull/18903/files#diff-81a0f32e0528f862f8ed8a7ba31d08fb9a21d8ab9d8fa90ec3a03fb75874b25eR200) is for that purpose?
**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:
What if there would be duplicates in `params.d_out_names`?
**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:
Removed. Сheck is now in onnx.hpp
**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 can. Fixed.
**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:
But.. it's just after the `if (!is_dynamic && !is_postproc)` condition...
**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:
May be `||`? Is `gp` always smaller?
**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:
It is "end data mark" for gapi output.
**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:
As I understand correctly, this way of validation can allow the following: the output of G-API is greater than ONNX output. But in that case the objects after `out_size` would not be validated... Is it correct?
**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:
G-Api output, that greater than ONNX output contains garbage. We check correct data with size from ONNX or until end of data mark. In remap we can choose any size for gapi output.
**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:
remove leading `/`
**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:
It make sense to add comment with decoding of field name
**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:
fix indentation
**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 comment.