nareshmlx/opencv-pr huggingface dataset:
**File:** modules/dnn/test/test_onnx_importer.cpp
**Change Type:** modified
**Context:** PR #24092: GSoC Add ONNX Support for GatherElements

**Code Changes:**
```diff
@@ -9,6 +9,7 @@
 #include "test_precomp.hpp"
 #include "npy_blob.hpp"
 #include <opencv2/dnn/shape_utils.hpp>
+#include <numeric>
 namespace opencv_test { namespace {
 
 template<typename TString>
@@ -2129,6 +2130,34 @@ TEST_P(Test_ONNX_nets, Alexnet)
     expectNoFallbacksFromIE(net);
```

Review comment:
Found another bug on the element-wise layer, see https://github.com/opencv/opencv/issues/24385.
**File:** modules/dnn/test/test_onnx_importer.cpp
**Change Type:** modified
**Context:** PR #24092: GSoC Add ONNX Support for GatherElements

**Code Changes:**
```diff
@@ -9,6 +9,7 @@
 #include "test_precomp.hpp"
 #include "npy_blob.hpp"
 #include <opencv2/dnn/shape_utils.hpp>
+#include <numeric>
 namespace opencv_test { namespace {
 
 template<typename TString>
@@ -2129,6 +2130,34 @@ TEST_P(Test_ONNX_nets, Alexnet)
     expectNoFallbacksFromIE(net);
```

Review comment:
Finally dnn can achieve the same accuracy with https://github.com/opencv/opencv/pull/24386 (greater fix), with or without #24378 (instancenorm).
**File:** modules/dnn/test/test_onnx_importer.cpp
**Change Type:** modified
**Context:** PR #24092: GSoC Add ONNX Support for GatherElements

**Code Changes:**
```diff
@@ -9,6 +9,7 @@
 #include "test_precomp.hpp"
 #include "npy_blob.hpp"
 #include <opencv2/dnn/shape_utils.hpp>
+#include <numeric>
 namespace opencv_test { namespace {
 
 template<typename TString>
@@ -2129,6 +2130,34 @@ TEST_P(Test_ONNX_nets, Alexnet)
     expectNoFallbacksFromIE(net);
```

Review comment:
This RAFT model takes nearly 2s for a single inference on my mac m1. I think we still need to replace with a smaller input scale version.
**File:** modules/dnn/test/test_onnx_importer.cpp
**Change Type:** modified
**Context:** PR #24092: GSoC Add ONNX Support for GatherElements

**Code Changes:**
```diff
@@ -9,6 +9,7 @@
 #include "test_precomp.hpp"
 #include "npy_blob.hpp"
 #include <opencv2/dnn/shape_utils.hpp>
+#include <numeric>
 namespace opencv_test { namespace {
 
 template<typename TString>
@@ -2129,6 +2130,34 @@ TEST_P(Test_ONNX_nets, Alexnet)
     expectNoFallbacksFromIE(net);
```

Review comment:
https://github.com/opencv/opencv/actions/runs/6506670391/job/17672657622?pr=24092 ``` [ RUN ] Test_ONNX_nets.RAFT/0, where GetParam() = OCV/CPU /Users/opencv-cn/GHA-OCV-1/_work/opencv/opencv/opencv/modules/dnn/test/test_common.impl.hpp:79: Failure Expected: (normInf) <= (lInf), actual: 0.000179291 vs 0.00014 |ref| = 0.47372817993164062 [ FAILED ] Test_ONNX_nets.RAFT/0, where GetParam() = OCV/CPU (1957 ms) [ RUN ] Test_ONNX_nets.RAFT/1, where GetParam() = OCV/CPU_FP16 /Users/opencv-cn/GHA-OCV-1/_work/opencv/opencv/opencv/modules/dnn/test/test_common.impl.hpp:79: Failure Expected: (normInf) <= (lInf), actual: 0.000179291 vs 0.00014 ```
**File:** modules/dnn/test/test_onnx_importer.cpp
**Change Type:** modified
**Context:** PR #24092: GSoC Add ONNX Support for GatherElements

**Code Changes:**
```diff
@@ -9,6 +9,7 @@
 #include "test_precomp.hpp"
 #include "npy_blob.hpp"
 #include <opencv2/dnn/shape_utils.hpp>
+#include <numeric>
 namespace opencv_test { namespace {
 
 template<typename TString>
@@ -2129,6 +2130,34 @@ TEST_P(Test_ONNX_nets, Alexnet)
     expectNoFallbacksFromIE(net);
```

Review comment:
Tested with a smaller input one but the time is almost the same. Lets keep what we have. Also I found that we have almost the same inference time compared to ONNX Runtime.
**File:** modules/dnn/test/test_onnx_importer.cpp
**Change Type:** modified
**Context:** PR #24092: GSoC Add ONNX Support for GatherElements

**Code Changes:**
```diff
@@ -9,6 +9,7 @@
 #include "test_precomp.hpp"
 #include "npy_blob.hpp"
 #include <opencv2/dnn/shape_utils.hpp>
+#include <numeric>
 namespace opencv_test { namespace {
 
 template<typename TString>
@@ -2129,6 +2130,34 @@ TEST_P(Test_ONNX_nets, Alexnet)
     expectNoFallbacksFromIE(net);
```

Review comment:
I suggest to add a tag to this test `applyTestTag(CV_TEST_TAG_LONG, CV_TEST_TAG_DEBUG_VERYLONG, CV_TEST_TAG_MEMORY_2GB);` to skip as long. PR is ready and might be merged.
**File:** modules/dnn/src/layers/gather_elements_layer.cpp
**Change Type:** added
**Context:** PR #24092: GSoC Add ONNX Support for GatherElements
**Review Line:** 73

**Code Changes:**
```diff
+    void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE
+    {
+        CV_TRACE_FUNCTION();
+        CV_TRACE_ARG_VALUE(name, "name", name.c_str());
+
+        std::vector<Mat> inputs, outputs;
+        inputs_arr.getMatVector(inputs);
+        outputs_arr.getMatVector(outputs);
+
+        const Mat& data = inputs[0];
+        const Mat& indices = inputs[1];
```

Review comment:
Implementation should handle FP16 datatype too ``` [ FAILED ] 3 tests, listed below: [ FAILED ] Test_ONNX_conformance.Layer_Test/test_gather_elements_0_OCV_OCL_FP16, where GetParam() = (test_gather_elements_0, OCV/OCL_FP16) [ FAILED ] Test_ONNX_conformance.Layer_Test/test_gather_elements_1_OCV_OCL_FP16, where GetParam() = (test_gather_elements_1, OCV/OCL_FP16) [ FAILED ] Test_ONNX_conformance.Layer_Test/test_gather_elements_negative_indices_OCV_OCL_FP16, where GetParam() = (test_gather_elements_negative_indices, OCV/OCL_FP16) ``` https://pullrequest.opencv.org/buildbot/builders/4_x-lin64/builds/100283
**File:** modules/dnn/src/layers/gather_elements_layer.cpp
**Change Type:** added
**Context:** PR #24092: GSoC Add ONNX Support for GatherElements
**Review Line:** 73

**Code Changes:**
```diff
+    void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE
+    {
+        CV_TRACE_FUNCTION();
+        CV_TRACE_ARG_VALUE(name, "name", name.c_str());
+
+        std::vector<Mat> inputs, outputs;
+        inputs_arr.getMatVector(inputs);
+        outputs_arr.getMatVector(outputs);
+
+        const Mat& data = inputs[0];
+        const Mat& indices = inputs[1];
```

Review comment:
See https://github.com/opencv/opencv/pull/24427
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #24350: Encode QR code data to UTF-8

**Code Changes:**
```diff
@@ -2727,6 +2727,58 @@ bool QRDecode::samplingForVersion()
     return true;
 }
 
+
+static bool checkASCIIcompatible(const uint8_t* str, const size_t size) {
+    for (size_t i = 0; i < size; ++i) {
+        uint8_t byte = str[i];
+        if (byte >= 0x80)
+            return false;
```

Review comment:
data type check should go before the first loop on the line 2801. Do we really need `checkUTF8`? Which test cases fail without it?
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #24350: Encode QR code data to UTF-8

**Code Changes:**
```diff
@@ -2727,6 +2727,58 @@ bool QRDecode::samplingForVersion()
     return true;
 }
 
+
+static bool checkASCIIcompatible(const uint8_t* str, const size_t size) {
+    for (size_t i = 0; i < size; ++i) {
+        uint8_t byte = str[i];
+        if (byte >= 0x80)
+            return false;
```

Review comment:
According to our docstring, OpenCV should return result in UTF-8 format: https://github.com/opencv/opencv/blob/3dcaf1f28764ad38fbaff4d18fce81623fb334f2/modules/objdetect/include/opencv2/objdetect/graphical_code_detector.hpp#L30-L37
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #24350: Encode QR code data to UTF-8

**Code Changes:**
```diff
@@ -2727,6 +2727,58 @@ bool QRDecode::samplingForVersion()
     return true;
 }
 
+
+static bool checkASCIIcompatible(const uint8_t* str, const size_t size) {
+    for (size_t i = 0; i < size; ++i) {
+        uint8_t byte = str[i];
+        if (byte >= 0x80)
+            return false;
```

Review comment:
Without `checkUTF8` failed tests are: ``` [ FAILED ] Objdetect_QRCode.regression/24, where GetParam() = "russian.jpg" [ FAILED ] Objdetect_QRCode.regression/25, where GetParam() = "kanji.jpg" [ FAILED ] Objdetect_QRCode_Multi.regression/6, where GetParam() = ("4_qrcodes.png", "contours_based") [ FAILED ] Objdetect_QRCode_Multi.regression/7, where GetParam() = ("4_qrcodes.png", "aruco_based") [ FAILED ] Objdetect_QRCode_Multi.regression/8, where GetParam() = ("5_qrcodes.png", "contours_based") [ FAILED ] Objdetect_QRCode_Multi.regression/12, where GetParam() = ("7_qrcodes.png", "contours_based") [ FAILED ] Objdetect_QRCode_Multi.regression/13, where GetParam() = ("7_qrcodes.png", "aruco_based") ```
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #24350: Encode QR code data to UTF-8

**Code Changes:**
```diff
@@ -2727,6 +2727,58 @@ bool QRDecode::samplingForVersion()
     return true;
 }
 
+
+static bool checkASCIIcompatible(const uint8_t* str, const size_t size) {
+    for (size_t i = 0; i < size; ++i) {
+        uint8_t byte = str[i];
+        if (byte >= 0x80)
+            return false;
```

Review comment:
There is completely missing code for proper handling of data type and ECI information. Detail: https://en.wikipedia.org/wiki/Extended_Channel_Interpretation Unfortunately it requires sometimes code-page maps. P.S. Kanji is not properly handled (UTF-8 conversion is still required)
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #24350: Encode QR code data to UTF-8

**Code Changes:**
```diff
@@ -2727,6 +2727,58 @@ bool QRDecode::samplingForVersion()
     return true;
 }
 
+
+static bool checkASCIIcompatible(const uint8_t* str, const size_t size) {
+    for (size_t i = 0; i < size; ++i) {
+        uint8_t byte = str[i];
+        if (byte >= 0x80)
+            return false;
```

Review comment:
Agree, I wanted to take a look later to Kanji test too.
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #24350: Encode QR code data to UTF-8
**Review Line:** 2839

**Code Changes:**
```diff
+                    CV_LOG_INFO(NULL, "QUIRC_DATA_TYPE_BYTE with UTF-8 ECI must be UTF-8 compatible string");
+                    return false;
+                }
+                result_info.assign((const char*)qr_code_data.payload, qr_code_data.payload_len);
+            } else if (qr_code_data.eci == 25/*ECI_UTF_16BE*/) {
+                CV_LOG_INFO(NULL, "QR: UTF-16BE ECI is not supported");
+                return false;
+            } else if (checkASCIIcompatible(qr_code_data.payload, qr_code_data.payload_len)) {
+                CV_LOG_INFO(NULL, "QR: payload is ASCII compatible (special handling for symbols encoding is not needed)");
+                result_info.assign((const char*)qr_code_data.payload, qr_code_data.payload_len);
+            } else {
```

Review comment:
I propose to make it CV_LOG_WARING. INFO is not printed in regular builds.
**File:** modules/objdetect/src/qrcode.cpp
**Change Type:** modified
**Context:** PR #24350: Encode QR code data to UTF-8
**Review Line:** 2839

**Code Changes:**
```diff
+                    CV_LOG_INFO(NULL, "QUIRC_DATA_TYPE_BYTE with UTF-8 ECI must be UTF-8 compatible string");
+                    return false;
+                }
+                result_info.assign((const char*)qr_code_data.payload, qr_code_data.payload_len);
+            } else if (qr_code_data.eci == 25/*ECI_UTF_16BE*/) {
+                CV_LOG_INFO(NULL, "QR: UTF-16BE ECI is not supported");
+                return false;
+            } else if (checkASCIIcompatible(qr_code_data.payload, qr_code_data.payload_len)) {
+                CV_LOG_INFO(NULL, "QR: payload is ASCII compatible (special handling for symbols encoding is not needed)");
+                result_info.assign((const char*)qr_code_data.payload, qr_code_data.payload_len);
+            } else {
```

Review comment:
We should not spam with that message. QR detector is usually called for each frame.
**File:** cmake/checks/cpu_lsx.cpp
**Change Type:** added
**Context:** PR #23929: Optimize some function with lasx.

**Code Changes:**
```diff
@@ -0,0 +1,15 @@
+#include <stdio.h>
+#include <lsxintrin.h>
+
+int test()
+{
+    const float src[] = { 0.0f, 1.0f, 2.0f, 3.0f};
+    v4f32 val = (v4f32)__lsx_vld((const float*)(src), 0);
+    return __lsx_vpickve2gr_w(__lsx_vftint_w_s(val), 3);
+}
```

Review comment:
This is build check. No need to introduce `if defined` guards. In case if the check build fails (e.g. no include, no function, etc) the check fails and variable is set to false in CMake script.
**File:** cmake/OpenCVCompilerOptimizations.cmake
**Change Type:** modified
**Context:** PR #23929: Optimize some function with lasx.

**Code Changes:**
```diff
@@ -53,6 +53,7 @@ list(APPEND CPU_ALL_OPTIMIZATIONS NEON VFPV3 FP16 NEON_DOTPROD)
 list(APPEND CPU_ALL_OPTIMIZATIONS MSA)
 list(APPEND CPU_ALL_OPTIMIZATIONS VSX VSX3)
 list(APPEND CPU_ALL_OPTIMIZATIONS RVV)
+list(APPEND CPU_ALL_OPTIMIZATIONS LSX)
 list(APPEND CPU_ALL_OPTIMIZATIONS LASX)
 list(REMOVE_DUPLICATES CPU_ALL_OPTIMIZATIONS)
 
@@ -390,10 +391,16 @@ elseif(RISCV)
   set(CPU_BASELINE "DETECT" CACHE STRING "${HELP_CPU_BASELINE}")
```

Review comment:
CPU_LSX_TEST_FILE?
**File:** cmake/OpenCVCompilerOptimizations.cmake
**Change Type:** modified
**Context:** PR #23929: Optimize some function with lasx.

**Code Changes:**
```diff
@@ -53,6 +53,7 @@ list(APPEND CPU_ALL_OPTIMIZATIONS NEON VFPV3 FP16 NEON_DOTPROD)
 list(APPEND CPU_ALL_OPTIMIZATIONS MSA)
 list(APPEND CPU_ALL_OPTIMIZATIONS VSX VSX3)
 list(APPEND CPU_ALL_OPTIMIZATIONS RVV)
+list(APPEND CPU_ALL_OPTIMIZATIONS LSX)
 list(APPEND CPU_ALL_OPTIMIZATIONS LASX)
 list(REMOVE_DUPLICATES CPU_ALL_OPTIMIZATIONS)
 
@@ -390,10 +391,16 @@ elseif(RISCV)
   set(CPU_BASELINE "DETECT" CACHE STRING "${HELP_CPU_BASELINE}")
```

Review comment:
It doesn't make sense to set the same variable twice.
**File:** cmake/OpenCVCompilerOptimizations.cmake
**Change Type:** modified
**Context:** PR #23929: Optimize some function with lasx.

**Code Changes:**
```diff
@@ -53,6 +53,7 @@ list(APPEND CPU_ALL_OPTIMIZATIONS NEON VFPV3 FP16 NEON_DOTPROD)
 list(APPEND CPU_ALL_OPTIMIZATIONS MSA)
 list(APPEND CPU_ALL_OPTIMIZATIONS VSX VSX3)
 list(APPEND CPU_ALL_OPTIMIZATIONS RVV)
+list(APPEND CPU_ALL_OPTIMIZATIONS LSX)
 list(APPEND CPU_ALL_OPTIMIZATIONS LASX)
 list(REMOVE_DUPLICATES CPU_ALL_OPTIMIZATIONS)
 
@@ -390,10 +391,16 @@ elseif(RISCV)
   set(CPU_BASELINE "DETECT" CACHE STRING "${HELP_CPU_BASELINE}")
```

Review comment:
I changed the way to enable LASX by default by determining the CPU_BASELINE_DISABLE value.
**File:** modules/imgproc/src/resize.cpp
**Change Type:** modified
**Context:** PR #24412: Speed up line merging in INTER_AREA

**Code Changes:**
```diff
@@ -3019,6 +3019,111 @@ struct DecimateAlpha
 };
 
 
+namespace inter_area {
+#if (CV_SIMD || CV_SIMD_SCALABLE)
+inline void saturate_store(const float* src, uchar* dst) {
+    const v_int32 tmp0 = v_round(vx_load(src + 0 * VTraits<v_float32>::vlanes()));
+    const v_int32 tmp1 = v_round(vx_load(src + 1 * VTraits<v_float32>::vlanes()));
+    const v_int32 tmp2 = v_round(vx_load(src + 2 * VTraits<v_float32>::vlanes()));
```

Review comment:
In scalable intrinsics there is no `T::nlanes`, one should get current number of lanes via `VTraits<float32>::vlanes()` method. See RISC-V build failures.
**File:** modules/imgproc/src/resize.cpp
**Change Type:** modified
**Context:** PR #24412: Speed up line merging in INTER_AREA

**Code Changes:**
```diff
@@ -3019,6 +3019,111 @@ struct DecimateAlpha
 };
 
 
+namespace inter_area {
+#if (CV_SIMD || CV_SIMD_SCALABLE)
+inline void saturate_store(const float* src, uchar* dst) {
+    const v_int32 tmp0 = v_round(vx_load(src + 0 * VTraits<v_float32>::vlanes()));
+    const v_int32 tmp1 = v_round(vx_load(src + 1 * VTraits<v_float32>::vlanes()));
+    const v_int32 tmp2 = v_round(vx_load(src + 2 * VTraits<v_float32>::vlanes()));
```

Review comment:
`v_float32::nlanes` -> `VTraits<float32>::vlanes()`
**File:** modules/imgproc/src/resize.cpp
**Change Type:** modified
**Context:** PR #24412: Speed up line merging in INTER_AREA

**Code Changes:**
```diff
@@ -3019,6 +3019,111 @@ struct DecimateAlpha
 };
 
 
+namespace inter_area {
+#if (CV_SIMD || CV_SIMD_SCALABLE)
+inline void saturate_store(const float* src, uchar* dst) {
+    const v_int32 tmp0 = v_round(vx_load(src + 0 * VTraits<v_float32>::vlanes()));
+    const v_int32 tmp1 = v_round(vx_load(src + 1 * VTraits<v_float32>::vlanes()));
+    const v_int32 tmp2 = v_round(vx_load(src + 2 * VTraits<v_float32>::vlanes()));
```

Review comment:
Thx, done. BTW, it could be nice to change that API to make it constexpr.
**File:** modules/core/test/test_io.cpp
**Change Type:** modified
**Context:** PR #24416: (5.x) Merge 4.x - Contrib: https://github.com/opencv/opencv_contrib/pull/3578 Extra: https://github.com/opencv/opencv_extra/pull/1109 #2310...
**Review Line:** 773

**Code Changes:**
```diff
+        if (useMemory)
+        {
             EXPECT_EQ(0, cv::norm(_rd_in, _rd_out, NORM_INF));
         }
+        if (testReadWrite && !useMemory && !generateTestData) {
+            EXPECT_EQ(0, remove(name.c_str()));
+        }
     }
 }
 
@@ -810,7 +818,7 @@ TEST(Core_InputOutput, filestorage_heap_overflow)
```

Review comment:
Origin of this code is 4.x branch. To avoid merge conflicts in the future prefer to keep the code formatting from 4.x: ``` if (testReadWrite && !useMemory && !generateTestData) { EXPECT_EQ(0, remove(name.c_str())); } ``` --- If you want to change code formatting then you should go to 4.x first.
**File:** modules/core/include/opencv2/core/matx.hpp
**Change Type:** modified
**Context:** PR #24416: (5.x) Merge 4.x - Contrib: https://github.com/opencv/opencv_contrib/pull/3578 Extra: https://github.com/opencv/opencv_extra/pull/1109 #2310...

**Code Changes:**
```diff
@@ -225,7 +225,7 @@ template<typename _Tp, int m, int n> class Matx
     void copyTo(const _OutputArray& dst) const;
     void convertTo(const _OutputArray& dst, int type, double scale=1., double shift=0.) const;
 
-    _Tp val[m*n]; //< matrix elements
+    _Tp val[m*n]; ///< matrix elements
 };
 
 typedef Matx<float, 1, 2> Matx12f;
```

Review comment:
Where did you get this random change? There is nothing related on 4.x: ``` $ git diff 5.x-merge-4.x-origin..4.x -- modules/core/include/opencv2/core/matx.hpp diff --git a/modules/core/include/opencv2/core/matx.hpp b/modules/core/include/opencv2/core/matx.hpp index 686ff5d99b..d67168518f 100644 --- a/modules/core/include/opencv2/core/matx.hpp +++ b/modules/core/include/opencv2/core/matx.hpp @@ -215,7 +215,7 @@ public: template<int l> Matx(const Matx<_Tp, m, l>& a, const Matx<_Tp, l, n>& b, Matx_MatMulOp); Matx(const Matx<_Tp, n, m>& a, Matx_TOp); - _Tp val[m*n]; //< matrix elements + _Tp val[m*n]; ///< matrix elements }; typedef Matx<float, 1, 2> Matx12f; ```
**File:** samples/dnn/README.md
**Change Type:** modified
**Context:** PR #24416: (5.x) Merge 4.x - Contrib: https://github.com/opencv/opencv_contrib/pull/3578 Extra: https://github.com/opencv/opencv_extra/pull/1109 #2310...

**Code Changes:**
```diff
@@ -78,7 +78,7 @@ AR @[ IoU=0.50:0.95 | area= large | maxDets=100 ] | 0.528     | 0.528          |
 ```
 
 ## References
-* [Models downloading script](https://github.com/opencv/opencv/samples/dnn/download_models.py)
+* [Models downloading script](https://github.com/opencv/opencv/blob/5.x/samples/dnn/download_models.py)
 * [Configuration files adopted for OpenCV](https://github.com/opencv/opencv_extra/tree/5.x/testdata/dnn)
 * [How to import models from TensorFlow Object Detection API](https://github.com/opencv/opencv/wiki/TensorFlow-Object-Detection-API)
 * [Names of classes from different datasets](https://github.com/opencv/opencv/tree/5.x/samples/data/dnn)
```

Review comment:
> `5.x` => `4.x` How? Please follow the merge process.
**File:** modules/dnn/perf/perf_net.cpp
**Change Type:** modified
**Context:** PR #24416: (5.x) Merge 4.x - Contrib: https://github.com/opencv/opencv_contrib/pull/3578 Extra: https://github.com/opencv/opencv_extra/pull/1109 #2310...

**Code Changes:**
```diff
@@ -28,22 +28,28 @@ class DNNTestNetwork : public ::perf::TestBaseWithParam< tuple<Backend, Target>
         target = (dnn::Target)(int)get<1>(GetParam());
     }
 
-    void processNet(std::string weights, std::string proto, const Mat& input, const std::string& outputLayer = "")
-    {
-        randu(input, 0.0f, 1.0f);
-
+    void processNet(std::string weights, std::string proto,
+                    const std::vector<std::tuple<Mat, std::string>>& inputs, const std::string& outputLayer = ""){
```

Review comment:
Prefer to keep code formatting from 4.x branch to avoid merge conflicts in the future: https://github.com/opencv/opencv/blob/7757759205aa0040d9f277a06edff92e70c6634c/modules/dnn/perf/perf_net.cpp#L324-L326
**File:** modules/core/include/opencv2/core/matx.hpp
**Change Type:** modified
**Context:** PR #24416: (5.x) Merge 4.x - Contrib: https://github.com/opencv/opencv_contrib/pull/3578 Extra: https://github.com/opencv/opencv_extra/pull/1109 #2310...

**Code Changes:**
```diff
@@ -225,7 +225,7 @@ template<typename _Tp, int m, int n> class Matx
     void copyTo(const _OutputArray& dst) const;
     void convertTo(const _OutputArray& dst, int type, double scale=1., double shift=0.) const;
 
-    _Tp val[m*n]; //< matrix elements
+    _Tp val[m*n]; ///< matrix elements
 };
 
 typedef Matx<float, 1, 2> Matx12f;
```

Review comment:
https://github.com/opencv/opencv/pull/23109
**File:** modules/dnn/perf/perf_net.cpp
**Change Type:** modified
**Context:** PR #24416: (5.x) Merge 4.x - Contrib: https://github.com/opencv/opencv_contrib/pull/3578 Extra: https://github.com/opencv/opencv_extra/pull/1109 #2310...

**Code Changes:**
```diff
@@ -28,22 +28,28 @@ class DNNTestNetwork : public ::perf::TestBaseWithParam< tuple<Backend, Target>
         target = (dnn::Target)(int)get<1>(GetParam());
     }
 
-    void processNet(std::string weights, std::string proto, const Mat& input, const std::string& outputLayer = "")
-    {
-        randu(input, 0.0f, 1.0f);
-
+    void processNet(std::string weights, std::string proto,
+                    const std::vector<std::tuple<Mat, std::string>>& inputs, const std::string& outputLayer = ""){
```

Review comment:
There was signature change in 5.x after Halide removal. So there is a conflict anyway, if I presume formatting.
**File:** modules/core/include/opencv2/core/matx.hpp
**Change Type:** modified
**Context:** PR #24416: (5.x) Merge 4.x - Contrib: https://github.com/opencv/opencv_contrib/pull/3578 Extra: https://github.com/opencv/opencv_extra/pull/1109 #2310...

**Code Changes:**
```diff
@@ -225,7 +225,7 @@ template<typename _Tp, int m, int n> class Matx
     void copyTo(const _OutputArray& dst) const;
     void convertTo(const _OutputArray& dst, int type, double scale=1., double shift=0.) const;
 
-    _Tp val[m*n]; //< matrix elements
+    _Tp val[m*n]; ///< matrix elements
 };
 
 typedef Matx<float, 1, 2> Matx12f;
```

Review comment:
There is no new lines: https://github.com/opencv/opencv/pull/23109/files#diff-c8967625aba7b9d3e3df706034cddf3a6f97b48f76ed06a3d9ede8568fe68f25
**File:** modules/dnn/perf/perf_net.cpp
**Change Type:** modified
**Context:** PR #24416: (5.x) Merge 4.x - Contrib: https://github.com/opencv/opencv_contrib/pull/3578 Extra: https://github.com/opencv/opencv_extra/pull/1109 #2310...

**Code Changes:**
```diff
@@ -28,22 +28,28 @@ class DNNTestNetwork : public ::perf::TestBaseWithParam< tuple<Backend, Target>
         target = (dnn::Target)(int)get<1>(GetParam());
     }
 
-    void processNet(std::string weights, std::string proto, const Mat& input, const std::string& outputLayer = "")
-    {
-        randu(input, 0.0f, 1.0f);
-
+    void processNet(std::string weights, std::string proto,
+                    const std::vector<std::tuple<Mat, std::string>>& inputs, const std::string& outputLayer = ""){
```

Review comment:
Origin is 4.x. Halide removal PR change formatting here wrongly. We should prefer original formatting (from base branch) to minimize merge conflicts in the future.