nareshmlx/opencv-pr huggingface dataset:
**File:** modules/core/src/cuda_stream.cpp
**Change Type:** modified
**Context:** PR #19286: add cuda::Stream constructor with cuda stream flags

**Code Changes:**
```diff
@@ -41,6 +41,7 @@
 //M*/
 
 #include "precomp.hpp"
+#include <cstdint>
 
 using namespace cv;
 using namespace cv::cuda;
@@ -293,6 +294,7 @@ class cv::cuda::Stream::Impl
 
```

Review comment:
I do believe we need a limit test somewhere. It is illegal to pass negative numbers. Since the python shim infrastructure has a bug/issue (gives non-important warnings), I can't use unsigned int. This was discussed multiple times before.
**File:** modules/core/include/opencv2/core/cuda.hpp
**Change Type:** modified
**Context:** PR #19286: add cuda::Stream constructor with cuda stream flags

**Code Changes:**
```diff
@@ -656,6 +656,18 @@ class CV_EXPORTS_W Stream
     //! creates a new asynchronous stream with custom allocator
     CV_WRAP Stream(const Ptr<GpuMat::Allocator>& allocator);
 
+    /** @brief creates a new Stream using the cudaFlags argument to determine the behaviors of the stream
+
+    @note The cudaFlags parameter is passed to the underlying api cudaStreamCreateWithFlags() and
+    supports the same parameter values.
+    @code
+        // creates an OpenCV cuda::Stream that manages an asynchronous, non-blocking,
```

Review comment:
I took a look a bit more at bindings generators. There is `size_t` type support in bindings.
**File:** modules/core/src/cuda_stream.cpp
**Change Type:** modified
**Context:** PR #19286: add cuda::Stream constructor with cuda stream flags

**Code Changes:**
```diff
@@ -41,6 +41,7 @@
 //M*/
 
 #include "precomp.hpp"
+#include <cstdint>
 
 using namespace cv;
 using namespace cv::cuda;
@@ -293,6 +294,7 @@ class cv::cuda::Stream::Impl
 
```

Review comment:
Please use type safe `unsigned int` in internal implementation.
**File:** modules/core/include/opencv2/core/cuda.hpp
**Change Type:** modified
**Context:** PR #19286: add cuda::Stream constructor with cuda stream flags

**Code Changes:**
```diff
@@ -656,6 +656,18 @@ class CV_EXPORTS_W Stream
     //! creates a new asynchronous stream with custom allocator
     CV_WRAP Stream(const Ptr<GpuMat::Allocator>& allocator);
 
+    /** @brief creates a new Stream using the cudaFlags argument to determine the behaviors of the stream
+
+    @note The cudaFlags parameter is passed to the underlying api cudaStreamCreateWithFlags() and
+    supports the same parameter values.
+    @code
+        // creates an OpenCV cuda::Stream that manages an asynchronous, non-blocking,
```

Review comment:
I am pushing again to check for any warnings on the CI platforms. Using `size_t` in this way is not in alignment with intention of the type https://en.cppreference.com/w/cpp/types/size_t It may work on all common platforms/data models today. And it may fail in the future due to using `size_t` in a way the C++ standard did not intend.
**File:** modules/dnn/src/layers/convolution_layer.cpp
**Change Type:** modified
**Context:** PR #19057: Preparations for enabling 1D support for Conv and Pool operations on CUDA - relates: https://github.com/opencv/opencv/pull/18862 https://gi...

**Code Changes:**
```diff
@@ -117,6 +117,9 @@ class BaseConvolutionLayerImpl : public ConvolutionLayer
         {
             kernel_size.assign(1, kernel_size[0]);
             strides.assign(1, strides[0]);
+            dilations.assign(1, dilations[0]);
+            pads_begin.assign(1, pads_begin[0]);
+            pads_end.assign(1, pads_end[0]);
         }
         CV_Assert(weightShape.dims() == kernel_size.size() + 2);
         for (int i = 0; i < kernel_size.size(); i++) {
```

Review comment:
There is no such code on "master" branch.
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
I think, comments should be changed (updated with new info for CHW/HWC) as well
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
So if `with_pad == true` all the code above doesn't make sense, right? Shouldn't it be below under `else`?
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
Isn't it better when grayscale `pp` is just explicitly moved to `dst` in `else`? in `if` it is also moved there, but, I mean, non-trivially
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
Why is it better to put `src` in the corner than in the center?
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
So `HWC` can't be grayscale?
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -11,6 +11,7 @@
 #include <stdexcept>
 #include <onnxruntime_cxx_api.h>
 #include <ade/util/iota_range.hpp>
+#include <codecvt> // wstring_convert
 
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/infer/onnx.hpp>
@@ -257,7 +258,13 @@ class ONNXtest : public ::testing::Test {
     template<typename T>
```

Review comment:
`squeeze` :)
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
[Preproc. steps](https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/faster-rcnn#preprocessing-steps)
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
Why? `>=` now.
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
Refactored
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
CV_MAKETYPE(ddepth, 3)
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
I don't see why you should add `>=` here: if input is 1-channeled, there are no planes it should be divided to, so it should go to `else` branch and just be copied to dst
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
Fixed. I understood.
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
This comment should be vice versa, right? if Mat is_not_hwc, i. e. CHW => dimensions [C*H, W, 1]
**File:** modules/gapi/include/opencv2/gapi/infer/onnx.hpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -86,7 +86,7 @@ template<typename Net> class Params {
     };
 
     // BEGIN(G-API's network parametrization API)
-    GBackend      backend() const { return cv::gapi::onnx::backend();  }
+    GBackend      backend() const { return cv::gapi::onnx::backend(); }
     std::string   tag()     const { return Net::tag(); }
     cv::util::any params()  const { return { desc }; }
     // END(G-API's network parametrization API)
```

Review comment:
What if a certain input layer doesn't require padding?
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
Default values here please.
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
Please fix the old formatting, also maybe `?` as a single character works better than `..` in the comment section.
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
`const bool`
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
so what we specify in parameters is an absolute size (to pad *to*), or a padding size (to pad *with*)?
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
Even with HWC, not sure if we should make Mat as a multi-channel image rather than an N-dimensional mat. Or where does this padding stands in the preprocessing pipeline?
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
The padding value (where you hardcode it to `0.f`) may need to be customizable. Also -- the padding policy may need to be customizable. What you have here is an analogue to `BORDER_CONST`. There're also `MIRROR`, `REPLICATE`, and so on are defined for image processing.
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
This may be a separate task, if the current API is enough to complete the current work/sample.
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.
**Review Line:** 296

**Code Changes:**
```diff
+                ? with_batch
+                    ? std::vector<int>{1, new_h, new_w, new_c}
+                    : std::vector<int>{new_h, new_w, new_c}
+                : with_batch
+                    ? std::vector<int>{1, new_c, new_h, new_w}
+                    : std::vector<int>{new_c, new_h, new_w};
             dst = dst.reshape(1, out_dims);
         } else {
             // Reshape to ONNX dimensions (no -1s there!)
@@ -565,7 +574,13 @@ ONNXCompiled::ONNXCompiled(const gapi::onnx::detail::ParamDesc &pp)
     // Create and initialize the ONNX session
```

Review comment:
Does ONNX expect a 3-dim vector in that particular case?
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -11,6 +11,7 @@
 #include <stdexcept>
 #include <onnxruntime_cxx_api.h>
 #include <ade/util/iota_range.hpp>
+#include <codecvt> // wstring_convert
 
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/infer/onnx.hpp>
@@ -257,7 +258,13 @@ class ONNXtest : public ::testing::Test {
     template<typename T>
```

Review comment:
It seems I don't understand the semantics for this function completely. Is there an API document available?
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.
**Review Line:** 296

**Code Changes:**
```diff
+                ? with_batch
+                    ? std::vector<int>{1, new_h, new_w, new_c}
+                    : std::vector<int>{new_h, new_w, new_c}
+                : with_batch
+                    ? std::vector<int>{1, new_c, new_h, new_w}
+                    : std::vector<int>{new_c, new_h, new_w};
             dst = dst.reshape(1, out_dims);
         } else {
             // Reshape to ONNX dimensions (no -1s there!)
@@ -565,7 +574,13 @@ ONNXCompiled::ONNXCompiled(const gapi::onnx::detail::ParamDesc &pp)
     // Create and initialize the ONNX session
```

Review comment:
`with_batch = ti.dims.size() == 4u ? true : false;` where `ti` - tensor info, which contains `dims` obtained from network parameters (`session.GetInputTypeInfo(...).GetTensorTypeAndShapeInfo().GetShape()`). Mask/FasterRCNN expects a 3-dim input for example.
**File:** modules/gapi/test/infer/gapi_infer_onnx_test.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -11,6 +11,7 @@
 #include <stdexcept>
 #include <onnxruntime_cxx_api.h>
 #include <ade/util/iota_range.hpp>
+#include <codecvt> // wstring_convert
 
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/infer/onnx.hpp>
@@ -257,7 +258,13 @@ class ONNXtest : public ::testing::Test {
     template<typename T>
```

Review comment:
Removed after "padding" discussion.
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -14,6 +14,7 @@
 #include <opencv2/gapi/infer.hpp>
 #include <opencv2/gapi/own/convert.hpp>
 #include <opencv2/gapi/gframe.hpp>
+#include <codecvt> // wstring_convert
 
 #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK!
 #include "logger.hpp"
@@ -218,17 +219,21 @@ inline void preprocess(const cv::Mat& src,
     } else {
```

Review comment:
Removed after "padding" discussion.
**File:** modules/gapi/include/opencv2/gapi/infer/onnx.hpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.

**Code Changes:**
```diff
@@ -86,7 +86,7 @@ template<typename Net> class Params {
     };
 
     // BEGIN(G-API's network parametrization API)
-    GBackend      backend() const { return cv::gapi::onnx::backend();  }
+    GBackend      backend() const { return cv::gapi::onnx::backend(); }
     std::string   tag()     const { return Net::tag(); }
     cv::util::any params()  const { return { desc }; }
     // END(G-API's network parametrization API)
```

Review comment:
Removed after "padding" discussion.
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.
**Review Line:** 583

**Code Changes:**
```diff
     this_session = Ort::Session(this_env, params.model_path.data(), session_options);
+#else
+    std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> converter;
+    std::wstring w_model_path = converter.from_bytes(params.model_path.data());
+    this_session = Ort::Session(this_env, w_model_path.data(), session_options);
+#endif
     this_memory_info = Ort::MemoryInfo::CreateCpu(OrtArenaAllocator, OrtMemTypeDefault);
 
     in_tensor_info = getTensorInfo(INPUT);
```

Review comment:
ort::Session on Windows expects wchar_t* instead char*
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.
**Review Line:** 583

**Code Changes:**
```diff
     this_session = Ort::Session(this_env, params.model_path.data(), session_options);
+#else
+    std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> converter;
+    std::wstring w_model_path = converter.from_bytes(params.model_path.data());
+    this_session = Ort::Session(this_env, w_model_path.data(), session_options);
+#endif
     this_memory_info = Ort::MemoryInfo::CreateCpu(OrtArenaAllocator, OrtMemTypeDefault);
 
     in_tensor_info = getTensorInfo(INPUT);
```

Review comment:
Currently I don't have BKMs for that. Try to validate that on your side (original "fix" doesn't look right in case of UTF-8 `std::string`). --- BTW, modern Windows versions may support UTF-8 encoding from the box: https://www.reddit.com/r/cpp/comments/g7tkd7/state_of_utf8_support_on_windows/
**File:** modules/gapi/src/backends/onnx/gonnxbackend.cpp
**Change Type:** modified
**Context:** PR #18943: G-API: ONNX. Support for networks with three dimensional input.
**Review Line:** 583

**Code Changes:**
```diff
     this_session = Ort::Session(this_env, params.model_path.data(), session_options);
+#else
+    std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> converter;
+    std::wstring w_model_path = converter.from_bytes(params.model_path.data());
+    this_session = Ort::Session(this_env, w_model_path.data(), session_options);
+#endif
     this_memory_info = Ort::MemoryInfo::CreateCpu(OrtArenaAllocator, OrtMemTypeDefault);
 
     in_tensor_info = getTensorInfo(INPUT);
```

Review comment:
Have a look on this: https://github.com/opencv/opencv/blob/master/modules/gapi/test/render/gapi_render_tests_ocv.cpp#L100