nareshmlx/opencv-pr huggingface dataset:
**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:
Fixed. This looks like implementation in `gapi_render_tests_ocv.cpp` now.
**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:
Please move it to `.cpp` if you only need it in `.cpp`.
**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:
Comment alignment is not yet fixed.
**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:
`return false` moved right. If comment about it.
**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:
Tests use conversion to wstring on Windows.
**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:
Then tests should include this, but not your generic public header.
**File:** doc/tutorials/dnn/dnn_pytorch_tf_classification/pytorch_cls_model_conversion_tutorial.md
**Change Type:** added
**Context:** PR #17604: [GSoC] Added TF and PyTorch classification conversion cases

**Code Changes:**
```diff
@@ -0,0 +1,362 @@
+# Conversion of PyTorch Classification Models and Launch with OpenCV Python {#pytorch_cls_tutorial_dnn_conversion}
+
+@prev_tutorial{tutorial_dnn_OCR}
+@next_tutorial{pytorch_cls_c_tutorial_dnn_conversion}
+
+|    |    |
+| -: | :- |
+| Original author | Anastasia Murzova |
+| Compatibility | OpenCV >= 4.5 |
```

Review comment:
> https://docs.opencv.org/4.3.0/ Please remove such links from the document. Doxygen reference should be used instead
**File:** samples/dnn/dnn_model_runner/dnn_conversion/requirements.txt
**Change Type:** added
**Context:** PR #17604: [GSoC] Added TF and PyTorch classification conversion cases

**Code Changes:**
```diff
@@ -0,0 +1,9 @@
+# Python 3.7.5
+onnx>=1.7.0
+numpy>=1.19.1
+
+torch>=1.5.1
+torchvision>=0.6.1
+
+tensorflow>=2.1.0
+tensorflow-gpu>=2.1.0
```

Review comment:
``` Double requirement given: torch>=1.7.0.dev20200727 (from -r ./requirements.txt (line 15)) (already in torch>=1.5.1 (from -r ./requirements.txt (line 5)), name='torch') ```
**File:** doc/tutorials/dnn/dnn_pytorch_tf_classification/tf_cls_model_conversion_tutorial.md
**Change Type:** added
**Context:** PR #17604: [GSoC] Added TF and PyTorch classification conversion cases

**Code Changes:**
```diff
@@ -0,0 +1,360 @@
+# Conversion of TensorFlow Classification Models and Launch with OpenCV Python {#tf_cls_tutorial_dnn_conversion}
+
+|    |    |
+| -: | :- |
+| Original author | Anastasia Murzova |
+| Compatibility | OpenCV >= 4.5 |
+
+## Goals
+In this tutorial you will learn how to:
```

Review comment:
space is missing.
**File:** samples/dnn/dnn_model_runner/dnn_conversion/requirements.txt
**Change Type:** added
**Context:** PR #17604: [GSoC] Added TF and PyTorch classification conversion cases

**Code Changes:**
```diff
@@ -0,0 +1,9 @@
+# Python 3.7.5
+onnx>=1.7.0
+numpy>=1.19.1
+
+torch>=1.5.1
+torchvision>=0.6.1
+
+tensorflow>=2.1.0
+tensorflow-gpu>=2.1.0
```

Review comment:
Is there any reason to use non-stable PyTorch version?
**File:** samples/dnn/dnn_model_runner/dnn_conversion/requirements.txt
**Change Type:** added
**Context:** PR #17604: [GSoC] Added TF and PyTorch classification conversion cases

**Code Changes:**
```diff
@@ -0,0 +1,9 @@
+# Python 3.7.5
+onnx>=1.7.0
+numpy>=1.19.1
+
+torch>=1.5.1
+torchvision>=0.6.1
+
+tensorflow>=2.1.0
+tensorflow-gpu>=2.1.0
```

Review comment:
`dataclasses` module is missing for Python distros before 3.7.
**File:** doc/tutorials/dnn/dnn_pytorch_tf_classification/pytorch_cls_model_conversion_c_tutorial.md
**Change Type:** added
**Context:** PR #17604: [GSoC] Added TF and PyTorch classification conversion cases
**Review Line:** 163

**Code Changes:**
```diff
+./dnn/example_dnn_classification --model=../dnn/models/resnet50.onnx --input=../data/squirrel_cls.jpg --width=224 --height=224 --rgb=true --scale="0.003921569" --mean="123.675 116.28 103.53" --std="0.229 0.224 0.225" --crop=true --initial_width=256 --initial_height=256 --classes=../data/dnn/classification_classes_ILSVRC2012.txt
+```
+
+Let's explore ``classification.cpp`` key points step by step:
+
+1. read the model with cv::dnn::readNet, initialize the network:
+
+```cpp
+Net net = readNet(model, config, framework);
+```
+
```

Review comment:
The same about references.
**File:** doc/tutorials/dnn/dnn_pytorch_tf_classification/pytorch_cls_model_conversion_c_tutorial.md
**Change Type:** added
**Context:** PR #17604: [GSoC] Added TF and PyTorch classification conversion cases

**Code Changes:**
```diff
@@ -0,0 +1,220 @@
+# Conversion of PyTorch Classification Models and Launch with OpenCV C++ {#pytorch_cls_c_tutorial_dnn_conversion}
+
+@prev_tutorial{pytorch_cls_tutorial_dnn_conversion}
+
+|    |    |
+| -: | :- |
+| Original author | Anastasia Murzova |
+| Compatibility | OpenCV >= 4.5 |
+
```

Review comment:
> requirements.py typo: requirements.txt
**File:** doc/tutorials/dnn/dnn_pytorch_tf_classification/pytorch_cls_model_conversion_c_tutorial.md
**Change Type:** added
**Context:** PR #17604: [GSoC] Added TF and PyTorch classification conversion cases

**Code Changes:**
```diff
@@ -0,0 +1,220 @@
+# Conversion of PyTorch Classification Models and Launch with OpenCV C++ {#pytorch_cls_c_tutorial_dnn_conversion}
+
+@prev_tutorial{pytorch_cls_tutorial_dnn_conversion}
+
+|    |    |
+| -: | :- |
+| Original author | Anastasia Murzova |
+| Compatibility | OpenCV >= 4.5 |
+
```

Review comment:
> created activated?
**File:** doc/tutorials/dnn/dnn_pytorch_tf_classification/pytorch_cls_model_conversion_c_tutorial.md
**Change Type:** added
**Context:** PR #17604: [GSoC] Added TF and PyTorch classification conversion cases

**Code Changes:**
```diff
@@ -0,0 +1,220 @@
+# Conversion of PyTorch Classification Models and Launch with OpenCV C++ {#pytorch_cls_c_tutorial_dnn_conversion}
+
+@prev_tutorial{pytorch_cls_tutorial_dnn_conversion}
+
+|    |    |
+| -: | :- |
+| Original author | Anastasia Murzova |
+| Compatibility | OpenCV >= 4.5 |
+
```

Review comment:
Practice ? (as noun)
**File:** doc/tutorials/dnn/dnn_pytorch_tf_classification/tf_cls_model_conversion_tutorial.md
**Change Type:** added
**Context:** PR #17604: [GSoC] Added TF and PyTorch classification conversion cases

**Code Changes:**
```diff
@@ -0,0 +1,360 @@
+# Conversion of TensorFlow Classification Models and Launch with OpenCV Python {#tf_cls_tutorial_dnn_conversion}
+
+|    |    |
+| -: | :- |
+| Original author | Anastasia Murzova |
+| Compatibility | OpenCV >= 4.5 |
+
+## Goals
+In this tutorial you will learn how to:
```

Review comment:
> /master/ > `#L443-L445` It is better to add reference for exact commit or git tag (especially for cases with lines references) --- **Note**: this comment is related for external repositories only. It is OK to use master with OpenCV's repositories (but without exact lines numbers).
**File:** doc/tutorials/dnn/dnn_pytorch_tf_classification/tf_cls_model_conversion_tutorial.md
**Change Type:** added
**Context:** PR #17604: [GSoC] Added TF and PyTorch classification conversion cases

**Code Changes:**
```diff
@@ -0,0 +1,360 @@
+# Conversion of TensorFlow Classification Models and Launch with OpenCV Python {#tf_cls_tutorial_dnn_conversion}
+
+|    |    |
+| -: | :- |
+| Original author | Anastasia Murzova |
+| Compatibility | OpenCV >= 4.5 |
+
+## Goals
+In this tutorial you will learn how to:
```

Review comment:
Here is the permalink - `https://github.com/tensorflow/tensorflow/blob/02032fb477e9417197132648ec81e75beee9063a/tensorflow/python/keras/applications/mobilenet.py#L443-L445`.
**File:** doc/tutorials/dnn/dnn_pytorch_tf_classification/tf_cls_model_conversion_tutorial.md
**Change Type:** added
**Context:** PR #17604: [GSoC] Added TF and PyTorch classification conversion cases

**Code Changes:**
```diff
@@ -0,0 +1,360 @@
+# Conversion of TensorFlow Classification Models and Launch with OpenCV Python {#tf_cls_tutorial_dnn_conversion}
+
+|    |    |
+| -: | :- |
+| Original author | Anastasia Murzova |
+| Compatibility | OpenCV >= 4.5 |
+
+## Goals
+In this tutorial you will learn how to:
```

Review comment:
`requirements.txt` in link.
**File:** samples/dnn/classification.py
**Change Type:** modified
**Context:** PR #17604: [GSoC] Added TF and PyTorch classification conversion cases
**Review Line:** 88

**Code Changes:**
```diff
+        if args.initial_width and args.initial_height:
+            frame = cv.resize(frame, (args.initial_width, args.initial_height))
+
+        blob = cv.dnn.blobFromImage(frame, args.scale, (inpWidth, inpHeight), args.mean, args.rgb, crop=args.crop)
+        if args.std:
+            blob[0] /= np.asarray(args.std, dtype=np.float32).reshape(3, 1, 1)
+
+        # Run a model
+        net.setInput(blob)
+        out = net.forward()
+
```

Review comment:
Please add check to exclude devision by zero as in C++ version.
**File:** samples/dnn/dnn_model_runner/dnn_conversion/common/img_utils.py
**Change Type:** added
**Context:** PR #17604: [GSoC] Added TF and PyTorch classification conversion cases
**Review Line:** 18

**Code Changes:**
```diff
+
+def get_pytorch_preprocess(img):
+    img = img.astype(np.float32)
+    img *= BASE_IMG_SCALE_FACTOR
+    img -= [0.485, 0.456, 0.406]
+    img /= [0.229, 0.224, 0.225]
+    return img
```

Review comment:
The same values are in `default_preprocess_config.py`. Let's reuse the constants.
**File:** modules/dnn/src/darknet/darknet_io.cpp
**Change Type:** added
**Context:** PR #9705: Added DNN Darknet Yolo v2 for object detection - ``` opencv_extra=dnn_model_darknet_yolo_v2 ``` ### This pullrequest changes  Added neural n...

**Code Changes:**
```diff
@@ -0,0 +1,624 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Please, add an assertion for unknown layer types to prevent unexpected errors. In example, I can't read any model now because an every `layer_type` ends with `]` character (`convolutional]`, `maxpool]`). (Ubuntu OS).
**File:** modules/dnn/include/opencv2/dnn/dnn.hpp
**Change Type:** modified
**Context:** PR #9705: Added DNN Darknet Yolo v2 for object detection - ``` opencv_extra=dnn_model_darknet_yolo_v2 ``` ### This pullrequest changes  Added neural n...

**Code Changes:**
```diff
@@ -611,6 +611,14 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
         virtual ~Importer();
     };
 
+    /** @brief Reads a network model stored in <a href="https://pjreddie.com/darknet/">Darknet</a> model files.
+    *  @param cfgFile      path to the .cfg file with text description of the network architecture.
+    *  @param darknetModel path to the .weights file with learned network.
+    *  @returns Network object that ready to do forward, throw an exception in failure cases.
+    * @details This is shortcut consisting from DarknetImporter and Net::populateNet calls.
+    */
```

Review comment:
We defined methods like `createCaffeImporter` as deprecated. Please keep only `readNetFromDarknet`.
**File:** samples/dnn/yolo_object_detection.cpp
**Change Type:** added
**Context:** PR #9705: Added DNN Darknet Yolo v2 for object detection - ``` opencv_extra=dnn_model_darknet_yolo_v2 ``` ### This pullrequest changes  Added neural n...

**Code Changes:**
```diff
@@ -0,0 +1,117 @@
+#include <opencv2/dnn.hpp>
+#include <opencv2/dnn/shape_utils.hpp>
+#include <opencv2/imgproc.hpp>
+#include <opencv2/highgui.hpp>
+using namespace cv;
+using namespace cv::dnn;
+
+#include <fstream>
+#include <iostream>
```

Review comment:
It isn't necessary: just use `imread` with default argument (http://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56).
**File:** samples/dnn/yolo_object_detection.cpp
**Change Type:** added
**Context:** PR #9705: Added DNN Darknet Yolo v2 for object detection - ``` opencv_extra=dnn_model_darknet_yolo_v2 ``` ### This pullrequest changes  Added neural n...

**Code Changes:**
```diff
@@ -0,0 +1,117 @@
+#include <opencv2/dnn.hpp>
+#include <opencv2/dnn/shape_utils.hpp>
+#include <opencv2/imgproc.hpp>
+#include <opencv2/highgui.hpp>
+using namespace cv;
+using namespace cv::dnn;
+
+#include <fstream>
+#include <iostream>
```

Review comment:
Please, use `blobFromImage`'s arguments to make preprocessing (http://docs.opencv.org/3.3.0/d6/d0f/group__dnn.html#ga0507466a789702eda8ffcdfa37f4d194).
**File:** modules/dnn/src/darknet/darknet_io.cpp
**Change Type:** added
**Context:** PR #9705: Added DNN Darknet Yolo v2 for object detection - ``` opencv_extra=dnn_model_darknet_yolo_v2 ``` ### This pullrequest changes  Added neural n...

**Code Changes:**
```diff
@@ -0,0 +1,624 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
I'm a bit confused about reorg layer. Let the input is: ``` channel_0 channel_1 channel_2 channel_3 0 1 4 5 8 9 c d 2 3 6 7 a b e f ``` and reorgStride = 2. So an output shape is 4x4x1 and values are: ``` output 1 4 1 5 8 c 9 d 2 6 3 7 a e b f ``` ?
**File:** modules/dnn/src/darknet/darknet_io.cpp
**Change Type:** added
**Context:** PR #9705: Added DNN Darknet Yolo v2 for object detection - ``` opencv_extra=dnn_model_darknet_yolo_v2 ``` ### This pullrequest changes  Added neural n...

**Code Changes:**
```diff
@@ -0,0 +1,624 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
It works now but `Reproducibility_TinyYoloVoc` and `Reproducibility_YoloVoc` tests are failed for me. Do them passed locally?
**File:** modules/dnn/src/darknet/darknet_io.cpp
**Change Type:** added
**Context:** PR #9705: Added DNN Darknet Yolo v2 for object detection - ``` opencv_extra=dnn_model_darknet_yolo_v2 ``` ### This pullrequest changes  Added neural n...

**Code Changes:**
```diff
@@ -0,0 +1,624 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
I left unchanged a bit strange original implementation of this layer. It increases the field of view of each final activation. Reshape: **26 x 26 x 64 -> 13 x 13 x 256** ![reorg](https://user-images.githubusercontent.com/4096485/30909091-8c787fe8-a388-11e7-958f-f348ec1a524d.jpg) For `stride = 2` ``` input 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f ``` ``` output channel_0 channel_1 channel_2 channel_3 0 2 1 3 4 6 5 7 8 a 9 b c e d f ``` * OpenCV C++ example: http://coliru.stacked-crooked.com/a/eb13942be083fa3d * Darknet C++ example: http://coliru.stacked-crooked.com/a/225d7fb1f25b286c ---- * Param `reverse` usually absent in the cfg-file of model, so `reverse = 0` by default https://github.com/pjreddie/darknet/blob/master/src/parser.c#L387 * Then `l.reverse = reverse;` https://github.com/pjreddie/darknet/blob/master/src/reorg_layer.c#L28 * So the function `reorg()` is called with `forward=0`: https://github.com/pjreddie/darknet/blob/8215a8864d4ad07e058acafd75b2c6ff6600b9e8/src/reorg_layer.c#L108 * `reorg_cpu()`-implementation uses `out[in_index] = x[out_index];`: https://github.com/pjreddie/darknet/blob/master/src/blas.c#L25
**File:** modules/dnn/src/darknet/darknet_io.cpp
**Change Type:** added
**Context:** PR #9705: Added DNN Darknet Yolo v2 for object detection - ``` opencv_extra=dnn_model_darknet_yolo_v2 ``` ### This pullrequest changes  Added neural n...

**Code Changes:**
```diff
@@ -0,0 +1,624 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Why we track shapes? Doesn't weights file contain kernels shapes?
**File:** modules/dnn/src/darknet/darknet_io.cpp
**Change Type:** added
**Context:** PR #9705: Added DNN Darknet Yolo v2 for object detection - ``` opencv_extra=dnn_model_darknet_yolo_v2 ``` ### This pullrequest changes  Added neural n...

**Code Changes:**
```diff
@@ -0,0 +1,624 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Version numbers are used only to decide how many bytes to skip for `seen` value. `transpose` aren't used at all. Please make all unused variables from `NetParameter` are local.
**File:** modules/dnn/src/darknet/darknet_io.cpp
**Change Type:** added
**Context:** PR #9705: Added DNN Darknet Yolo v2 for object detection - ``` opencv_extra=dnn_model_darknet_yolo_v2 ``` ### This pullrequest changes  Added neural n...

**Code Changes:**
```diff
@@ -0,0 +1,624 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Please, setup only actual parameters: "pool", "kernel_size", "pad", "stride".
**File:** modules/dnn/src/darknet/darknet_io.cpp
**Change Type:** added
**Context:** PR #9705: Added DNN Darknet Yolo v2 for object detection - ``` opencv_extra=dnn_model_darknet_yolo_v2 ``` ### This pullrequest changes  Added neural n...

**Code Changes:**
```diff
@@ -0,0 +1,624 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Yes, weights file doesn't contain kernels shapes. Also Darknet tracks layers shapes while parsing a cfg-file: * `parse_network_cfg()` https://github.com/pjreddie/darknet/blob/master/src/parser.c#L630 * `parse_convolutional()` https://github.com/pjreddie/darknet/blob/master/src/parser.c#L169 * `make_convolutional_layer()` https://github.com/pjreddie/darknet/blob/master/src/convolutional_layer.c#L166 * `convolutional_out_height()` https://github.com/pjreddie/darknet/blob/master/src/convolutional_layer.c#L66 ``` int convolutional_out_height(convolutional_layer l) { return (l.h + 2*l.pad - l.size) / l.stride + 1; } ```
**File:** modules/dnn/src/layers/reorg_layer.cpp
**Change Type:** added
**Context:** PR #9705: Added DNN Darknet Yolo v2 for object detection - ``` opencv_extra=dnn_model_darknet_yolo_v2 ``` ### This pullrequest changes  Added neural n...

**Code Changes:**
```diff
@@ -0,0 +1,140 @@
+/*M ///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Is there no typo in `in`<->`out` indices place?