nareshmlx/opencv-pr huggingface dataset:
**File:** modules/video/src/tracking/tracker_vit.cpp
**Change Type:** added
**Context:** PR #24201: vittrack(gsoc realtime object tracking model)

**Code Changes:**
```diff
@@ -0,0 +1,219 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+// Author, PengyuLiu, 1872918507@qq.com
+
+#include "../precomp.hpp"
+#ifdef HAVE_OPENCV_DNN
+#include "opencv2/dnn.hpp"
```

Review comment:
I propose to move it to parameters. In case if users re-trained the model they can use custom pre-proc params.
**File:** samples/dnn/vit_tracker.cpp
**Change Type:** added
**Context:** PR #24201: vittrack(gsoc realtime object tracking model)

**Code Changes:**
```diff
@@ -0,0 +1,176 @@
+// VitTracker
+// model: https://github.com/opencv/opencv_zoo/tree/main/models/object_tracking_vittrack
+
+#include <iostream>
+#include <cmath>
+
+#include <opencv2/dnn.hpp>
+#include <opencv2/imgproc.hpp>
+#include <opencv2/highgui.hpp>
```

Review comment:
Use opencv_zoo too to avoid mess of different sources Also it makes sense to dump suggested model path in `--help` mode.
**File:** modules/video/src/tracking/tracker_vit.cpp
**Change Type:** added
**Context:** PR #24201: vittrack(gsoc realtime object tracking model)

**Code Changes:**
```diff
@@ -0,0 +1,219 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+// Author, PengyuLiu, 1872918507@qq.com
+
+#include "../precomp.hpp"
+#ifdef HAVE_OPENCV_DNN
+#include "opencv2/dnn.hpp"
```

Review comment:
Avoid `cv::` usage in OpenCV .cpp files (there is already `namespace cv`)
**File:** samples/python/tracker.py
**Change Type:** modified
**Context:** PR #24201: vittrack(gsoc realtime object tracking model)

**Code Changes:**
```diff
@@ -22,6 +22,7 @@
                     [--dasiamrpn_backend DASIAMRPN_BACKEND]
                     [--dasiamrpn_target DASIAMRPN_TARGET]
                     [--nanotrack_backbone NANOTRACK_BACKEND] [--nanotrack_headneck NANOTRACK_TARGET]
+                    [--vittrack_net VITTRACK_MODEL]
 '''
 
 # Python 2/3 compatibility
@@ -61,6 +62,10 @@ def createTracker(self):
             params.backbone = args.nanotrack_backbone
```

Review comment:
Unconditional call of `.getTrackingScore()` breaks demo with other trackers.
**File:** modules/video/src/tracking/tracker_vit.cpp
**Change Type:** added
**Context:** PR #24201: vittrack(gsoc realtime object tracking model)

**Code Changes:**
```diff
@@ -0,0 +1,219 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+// Author, PengyuLiu, 1872918507@qq.com
+
+#include "../precomp.hpp"
+#ifdef HAVE_OPENCV_DNN
+#include "opencv2/dnn.hpp"
```

Review comment:
Is there any sample code available for reference?
**File:** modules/video/src/tracking/tracker_vit.cpp
**Change Type:** added
**Context:** PR #24201: vittrack(gsoc realtime object tracking model)

**Code Changes:**
```diff
@@ -0,0 +1,219 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+// Author, PengyuLiu, 1872918507@qq.com
+
+#include "../precomp.hpp"
+#ifdef HAVE_OPENCV_DNN
+#include "opencv2/dnn.hpp"
```

Review comment:
Actually these parameters are from the classic ImageNet image classification. Basically everybody uses these params by default. I dont see anyone changing them in any practical sense.
**File:** modules/video/include/opencv2/video/tracking.hpp
**Change Type:** modified
**Context:** PR #24201: vittrack(gsoc realtime object tracking model)

**Code Changes:**
```diff
@@ -887,6 +887,43 @@ class CV_EXPORTS_W TrackerNano : public Tracker
     //bool update(InputArray image, CV_OUT Rect& boundingBox) CV_OVERRIDE;
 };
 
+/** @brief the VIT tracker is a super lightweight dnn-based general object tracking.
+ *
+ *  VIT tracker is much faster and extremely lightweight due to special model structure, the model file is about 767KB.
+ *  Model download link: https://github.com/opencv/opencv_zoo/tree/main/models/object_tracking_vittrack
+ *  Author: PengyuLiu, 1872918507@qq.com
+ */
```

Review comment:
Link to the directory is enough in case the model name changes, e.g. `https://github.com/opencv/opencv_zoo/tree/main/models/object_tracking_vittrack`
**File:** modules/video/src/tracking/tracker_vit.cpp
**Change Type:** added
**Context:** PR #24201: vittrack(gsoc realtime object tracking model)

**Code Changes:**
```diff
@@ -0,0 +1,219 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+// Author, PengyuLiu, 1872918507@qq.com
+
+#include "../precomp.hpp"
+#ifdef HAVE_OPENCV_DNN
+#include "opencv2/dnn.hpp"
```

Review comment:
It's still relevant.
**File:** modules/video/src/tracking/tracker_vit.cpp
**Change Type:** added
**Context:** PR #24201: vittrack(gsoc realtime object tracking model)

**Code Changes:**
```diff
@@ -0,0 +1,219 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+// Author, PengyuLiu, 1872918507@qq.com
+
+#include "../precomp.hpp"
+#ifdef HAVE_OPENCV_DNN
+#include "opencv2/dnn.hpp"
```

Review comment:
The model may be re-trained for YUV or use-cases that are not classical RGB imaging in science, medicine, etc.
**File:** modules/video/include/opencv2/video/tracking.hpp
**Change Type:** modified
**Context:** PR #24201: vittrack(gsoc realtime object tracking model)

**Code Changes:**
```diff
@@ -887,6 +887,43 @@ class CV_EXPORTS_W TrackerNano : public Tracker
     //bool update(InputArray image, CV_OUT Rect& boundingBox) CV_OVERRIDE;
 };
 
+/** @brief the VIT tracker is a super lightweight dnn-based general object tracking.
+ *
+ *  VIT tracker is much faster and extremely lightweight due to special model structure, the model file is about 767KB.
+ *  Model download link: https://github.com/opencv/opencv_zoo/tree/main/models/object_tracking_vittrack
+ *  Author: PengyuLiu, 1872918507@qq.com
+ */
```

Review comment:
This most probably affects Python and Java Bindings. Please define them as `CV_PROP_RW Scalar meanvalue` and move initialization to the constructor implementation.
**File:** modules/dnn/include/opencv2/dnn/all_layers.hpp
**Change Type:** modified
**Context:** PR #24037: Add Support for Einsum Layer
**Review Line:** 244

**Code Changes:**
```diff
@@ -241,6 +241,39 @@ CV__DNN_INLINE_NS_BEGIN
 
     };
 
+    /** @brief This function performs array summation based
+    * on the Einstein summation convention. The function
+    * allows for concise expressions of various mathematical
+    * operations using subscripts.
+    *
+    * By default, the labels are placed in alphabetical
```

Review comment:
I think the docstring should be before `class CV_EXPORTS EinsumLayer : public Layer`
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -0,0 +1,1114 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include <inttypes.h>
+#include <opencv2/dnn/shape_utils.hpp>
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
```

Review comment:
Please use a shorter version: ``` // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. ```
**File:** modules/dnn/src/onnx/onnx_importer.cpp
**Change Type:** modified
**Context:** PR #24037: Add Support for Einsum Layer
**Review Line:** 3368

**Code Changes:**
```diff
+    // Check if of eqution is valid
+    std::string equation = layerParams.get<std::string>("equation");
+    CV_CheckFalse(equation.empty(), "Equation is empty");
+
+    // Save number of inputs. We need it in layer initialization
+    layerParams.set("inputSize", node_proto.input_size());
+
+    // Save number of outputs. We need it in layer initialization
+    layerParams.set("outputSize", node_proto.output_size());
+
+    addLayer(layerParams, node_proto);
```

Review comment:
Unused parameter
**File:** modules/dnn/include/opencv2/dnn/all_layers.hpp
**Change Type:** modified
**Context:** PR #24037: Add Support for Einsum Layer
**Review Line:** 244

**Code Changes:**
```diff
@@ -241,6 +241,39 @@ CV__DNN_INLINE_NS_BEGIN
 
     };
 
+    /** @brief This function performs array summation based
+    * on the Einstein summation convention. The function
+    * allows for concise expressions of various mathematical
+    * operations using subscripts.
+    *
+    * By default, the labels are placed in alphabetical
```

Review comment:
I copied it from LSTM layer. [Here](https://github.com/Abdurrahheem/opencv/blob/86657ed9e697f28d395f8def6b6a7a62941da6c9/modules/dnn/include/opencv2/dnn/all_layers.hpp#L96)
**File:** modules/dnn/src/onnx/onnx_importer.cpp
**Change Type:** modified
**Context:** PR #24037: Add Support for Einsum Layer
**Review Line:** 3368

**Code Changes:**
```diff
+    // Check if of eqution is valid
+    std::string equation = layerParams.get<std::string>("equation");
+    CV_CheckFalse(equation.empty(), "Equation is empty");
+
+    // Save number of inputs. We need it in layer initialization
+    layerParams.set("inputSize", node_proto.input_size());
+
+    // Save number of outputs. We need it in layer initialization
+    layerParams.set("outputSize", node_proto.output_size());
+
+    addLayer(layerParams, node_proto);
```

Review comment:
It will be used in the next patch!
**File:** modules/dnn/include/opencv2/dnn/all_layers.hpp
**Change Type:** modified
**Context:** PR #24037: Add Support for Einsum Layer
**Review Line:** 244

**Code Changes:**
```diff
@@ -241,6 +241,39 @@ CV__DNN_INLINE_NS_BEGIN
 
     };
 
+    /** @brief This function performs array summation based
+    * on the Einstein summation convention. The function
+    * allows for concise expressions of various mathematical
+    * operations using subscripts.
+    *
+    * By default, the labels are placed in alphabetical
```

Review comment:
check https://pullrequest.opencv.org/buildbot/export/pr/24037/docs/dd/d15/classcv_1_1dnn_1_1EinsumLayer.html docstring should lead class or method definition, like here: https://pullrequest.opencv.org/buildbot/export/pr/24037/docs/d2/dce/classcv_1_1dnn_1_1GRULayer.html
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer
**Review Line:** 35

**Code Changes:**
```diff
+        new_shape[i] = input_dims[perm[i]];
+    }
+    return true;
+}
+
+Mat batchwiseMatMul(
+    const Mat& input1,
+    const MatShape& input1ShapeOverride,
+    const Mat& input2,
+    const MatShape& input2ShapeOverride)
+{
```

Review comment:
Can we create an object of FullyConnected layer and use it for inference? For example, `Permute` layer inside [ShuffleChannel](https://github.com/opencv/opencv/blob/4.x/modules/dnn/src/layers/shuffle_channel_layer.cpp)
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -0,0 +1,1114 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include <inttypes.h>
+#include <opencv2/dnn/shape_utils.hpp>
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
```

Review comment:
I cannot find any line which changes result's value. Do we need it?
**File:** modules/dnn/test/test_onnx_importer.cpp
**Change Type:** modified
**Context:** PR #24037: Add Support for Einsum Layer
**Review Line:** 1423

**Code Changes:**
```diff
+TEST_P(Test_ONNX_layers, DISABLED_Einsum_1D)
+{
+    testONNXModels("einsum_1d", npy, 0, 0, false, false, 2);
+}
+
+TEST_P(Test_ONNX_layers, Einsum_2D)
+{
+    testONNXModels("einsum_2d", npy, 0, 0, false, false, 2);
+}
+
+TEST_P(Test_ONNX_layers, Einsum_3D)
```

Review comment:
Can we add the onnx conformance tests as well? There are 5 tests from the onnx repo: ``` $ONNX/onnx/backend/test/data/node/test_einsum_sum $ONNX/onnx/backend/test/data/node/test_einsum_inner_prod $ONNX/onnx/backend/test/data/node/test_einsum_batch_diagonal $ONNX/onnx/backend/test/data/node/test_einsum_transpose $ONNX/onnx/backend/test/data/node/test_einsum_batch_matmul ```
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer
**Review Line:** 98

**Code Changes:**
```diff
+            Mat part2 = reshapedInput2(ranges2);
+            int shape2[] = {static_cast<int>(K), static_cast<int>(N)};
+            part2 = part2.reshape(1, sizeof(shape2)/sizeof(shape2[0]), shape2);
+
+            Mat tmp_output;
+            cv::gemm(part1, part2, 1.0, cv::Mat(), 1.0, tmp_output);
+            int newShape[] = {1, static_cast<int>(M), static_cast<int>(N)};
+            tmp_output = tmp_output.reshape(1, sizeof(newShape)/sizeof(newShape[0]), newShape);
+
+            output.emplace_back(tmp_output);
+        }
```

Review comment:
You can use the fast_gemm which is introduced in https://github.com/opencv/opencv/pull/23897 once it is merged.
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -0,0 +1,1114 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include <inttypes.h>
+#include <opencv2/dnn/shape_utils.hpp>
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
```

Review comment:
The onnx standard require the number of Einsum layer output to be 1. I am not sure why we need to keep it as one of the params.
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -0,0 +1,1114 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include <inttypes.h>
+#include <opencv2/dnn/shape_utils.hpp>
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
```

Review comment:
It's bad idea to wrap function call with CV_Assert. In case if asserts are disabled (replaced by dummy code) by some reason the function is not called. I recommend to use asserts/errors in the function itself instead of boolean status.
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -0,0 +1,1114 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include <inttypes.h>
+#include <opencv2/dnn/shape_utils.hpp>
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
```

Review comment:
`int64_t` is overkill for this purpose. I propose to use just `int`.
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -0,0 +1,1114 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include <inttypes.h>
+#include <opencv2/dnn/shape_utils.hpp>
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
```

Review comment:
`int64_t` is overkill for such purposes.
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -0,0 +1,1114 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include <inttypes.h>
+#include <opencv2/dnn/shape_utils.hpp>
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
```

Review comment:
typo in comment.
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -0,0 +1,1114 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include <inttypes.h>
+#include <opencv2/dnn/shape_utils.hpp>
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
```

Review comment:
cast to size_t is redundant.
**File:** modules/dnn/include/opencv2/dnn/all_layers.hpp
**Change Type:** modified
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -241,6 +241,39 @@ CV__DNN_INLINE_NS_BEGIN
 
     };
 
+    /** @brief This function performs array summation based
+    * on the Einstein summation convention. The function
+    * allows for concise expressions of various mathematical
+    * operations using subscripts.
+    *
+    * By default, the labels are placed in alphabetical
```

Review comment:
Please mark not implemented cases with "TODO: " or remove from description for now.
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer
**Review Line:** 131

**Code Changes:**
```diff
+        Mat tmp_output;
+        cv::gemm(reshapedInput1, reshapedInput2, 1.0, cv::Mat(), 1.0, tmp_output);
+
+        int newShape[] = {1, static_cast<int>(M), static_cast<int>(N)};
+        tmp_output = tmp_output.reshape(1, sizeof(newShape)/sizeof(newShape[0]), newShape);
+        output.emplace_back(tmp_output);
+
+    }
+
+    int outputDim[] = {static_cast<int>(output.size()), static_cast<int>(M), static_cast<int>(N)};
+    Mat output_buffer = Mat::zeros(3, outputDim, CV_32F);
```

Review comment:
Looks like you can extract else branch content as a function and call it in else and also in the loop in `if block`.
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -0,0 +1,1114 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include <inttypes.h>
+#include <opencv2/dnn/shape_utils.hpp>
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
```

Review comment:
You can replace it with CV_Assert.
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -0,0 +1,1114 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include <inttypes.h>
+#include <opencv2/dnn/shape_utils.hpp>
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
```

Review comment:
It should be just single line CV_Assert.
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -0,0 +1,1114 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include <inttypes.h>
+#include <opencv2/dnn/shape_utils.hpp>
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
```

Review comment:
Is not used any more.
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -0,0 +1,1114 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include <inttypes.h>
+#include <opencv2/dnn/shape_utils.hpp>
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
```

Review comment:
technically equation become local variable in the constructor and parser and the field may be removed.
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -0,0 +1,1114 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include <inttypes.h>
+#include <opencv2/dnn/shape_utils.hpp>
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
```

Review comment:
unnecessary empty line.
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -0,0 +1,1114 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include <inttypes.h>
+#include <opencv2/dnn/shape_utils.hpp>
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
```

Review comment:
You can use CV_Assert like this: ``` CV_Assert(input_dims.size() == currSubscriptIndices.size() && "Rank of the input must match number of subscript labels corresponding to the input"); ```
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -0,0 +1,1114 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include <inttypes.h>
+#include <opencv2/dnn/shape_utils.hpp>
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
```

Review comment:
Is the comment is relevant?
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -0,0 +1,1114 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include <inttypes.h>
+#include <opencv2/dnn/shape_utils.hpp>
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
```

Review comment:
In case, if you need a copy, you can replace `const String& equation` with `String equation` in parameters. Copy is done automatically by compiler.
**File:** modules/dnn/src/layers/einsum_layer.cpp
**Change Type:** added
**Context:** PR #24037: Add Support for Einsum Layer

**Code Changes:**
```diff
@@ -0,0 +1,1114 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include <inttypes.h>
+#include <opencv2/dnn/shape_utils.hpp>
+#include "../precomp.hpp"
+#include "layers_common.hpp"
+
```

Review comment:
Do you really need to `erase`? You can jsy increment the first parameter in the line above.