nareshmlx/opencv-pr huggingface dataset:
**File:** modules/dnn/test/test_halide_layers.cpp
**Change Type:** modified
**Context:** PR #15808: Added Swish and Mish activations - I have added the Swish and Mish activation functions. This resolves https://github.com/opencv/opencv/iss...
**Review Line:** 586

**Code Changes:**
```diff
@@ -583,7 +583,7 @@ TEST_P(NoParamActivation, Accuracy)
     testInPlaceActivation(lp, backendId, targetId);
 }
 INSTANTIATE_TEST_CASE_P(Layer_Test_Halide, NoParamActivation, Combine(
-/*type*/ Values("TanH", "Sigmoid", "AbsVal", "BNLL"),
+/*type*/ Values("TanH", "Sigmoid", "AbsVal", "BNLL", "Swish", "Mish"),
          dnnBackendsAndTargetsWithHalide()
 ));
 
```

Review comment:
The CUDA tests are passing for the Swish activation. The test for `DNN_TARGET_CUDA` is passing for the Mish activation. The test for `DNN_TARGET_CUDA_FP16` is failing. ``` [ RUN ] Layer_Test_Halide/NoParamActivation.Accuracy/21, where GetParam() = ("Mish", CUDA/CUDA_FP16) .../opencv/modules/dnn/test/test_common.impl.hpp:68: Failure Expected: (normL1) <= (l1), actual: 0.0288897 vs 0.004 .../opencv/modules/dnn/test/test_common.impl.hpp:71: Failure Expected: (normInf) <= (lInf), actual: 0.0909604 vs 0.02 ``` This means that the errors in the outputs are more than the accepted threshold. You will have to increase the error tolerance for Mish activation when target is `DNN_TARGET_CUDA_FP16`. I am not sure what would be the correct way to do this. In the worst case, the test can be skipped for the FP16 target. The test calls `void testInPlaceActivation(LayerParams& lp, Backend backendId, Target targetId)` which in turn calls `void test(Mat& input, Net& net, Backend backendId, Target targetId, bool skipCheck = false)`. I think currently there is no way to pass custom thresholds to `test`. A solution could be to pass thresholds to `testInPlaceActivation` and `test` as arguments.
**File:** modules/dnn/test/test_halide_layers.cpp
**Change Type:** modified
**Context:** PR #15808: Added Swish and Mish activations - I have added the Swish and Mish activation functions. This resolves https://github.com/opencv/opencv/iss...
**Review Line:** 586

**Code Changes:**
```diff
@@ -583,7 +583,7 @@ TEST_P(NoParamActivation, Accuracy)
     testInPlaceActivation(lp, backendId, targetId);
 }
 INSTANTIATE_TEST_CASE_P(Layer_Test_Halide, NoParamActivation, Combine(
-/*type*/ Values("TanH", "Sigmoid", "AbsVal", "BNLL"),
+/*type*/ Values("TanH", "Sigmoid", "AbsVal", "BNLL", "Swish", "Mish"),
          dnnBackendsAndTargetsWithHalide()
 ));
 
```

Review comment:
The default Thresholds are being called from here https://github.com/thebhatman/opencv/blob/f6221044661dedbf4ad729c8f24c2b72ff37aca0/modules/dnn/test/test_common.hpp#L113. I don't see a way to pass the thresholds as arguments without changing the prototype of `testInPlaceActivation` .
**File:** modules/dnn/src/layers/elementwise_layers.cpp
**Change Type:** modified
**Context:** PR #15808: Added Swish and Mish activations - I have added the Swish and Mish activation functions. This resolves https://github.com/opencv/opencv/iss...

**Code Changes:**
```diff
@@ -613,6 +613,184 @@ struct TanHFunctor
     int64 getFLOPSPerElement() const { return 1; }
 };
 
+struct SwishFunctor
+{
+    typedef SwishLayer Layer;
+
+    bool supportBackend(int backendId, int)
+    {
```

Review comment:
There is no `SwishLayer` in this namespace. Please remove IE backend support for now. The same for MishLayer.
**File:** modules/dnn/src/layers/elementwise_layers.cpp
**Change Type:** modified
**Context:** PR #15808: Added Swish and Mish activations - I have added the Swish and Mish activation functions. This resolves https://github.com/opencv/opencv/iss...

**Code Changes:**
```diff
@@ -613,6 +613,184 @@ struct TanHFunctor
     int64 getFLOPSPerElement() const { return 1; }
 };
 
+struct SwishFunctor
+{
+    typedef SwishLayer Layer;
+
+    bool supportBackend(int backendId, int)
+    {
```

Review comment:
Please remove IE backend from this check and similar one in Mish layer.
**File:** modules/dnn/src/layers/elementwise_layers.cpp
**Change Type:** modified
**Context:** PR #15808: Added Swish and Mish activations - I have added the Swish and Mish activation functions. This resolves https://github.com/opencv/opencv/iss...

**Code Changes:**
```diff
@@ -613,6 +613,184 @@ struct TanHFunctor
     int64 getFLOPSPerElement() const { return 1; }
 };
 
+struct SwishFunctor
+{
+    typedef SwishLayer Layer;
+
+    bool supportBackend(int backendId, int)
+    {
```

Review comment:
I have removed it now.
**File:** samples/dnn/text_detection.py
**Change Type:** modified
**Context:** PR #16955: add text python recognition sample

**Code Changes:**
```diff
@@ -1,25 +1,81 @@
+'''
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+    import torch
+    import models.crnn as CRNN
+    model = CRNN(32, 1, 37, 256)
```

Review comment:
Why not to have `outputSize = (100, 32)`? So we can pass it directly into the method.
**File:** samples/dnn/text_detection.py
**Change Type:** modified
**Context:** PR #16955: add text python recognition sample

**Code Changes:**
```diff
@@ -1,25 +1,81 @@
+'''
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+    import torch
+    import models.crnn as CRNN
+    model = CRNN(32, 1, 37, 256)
```

Review comment:
`blobFromImage` does conversion internally so it's not necessary.
**File:** samples/dnn/text_detection.py
**Change Type:** modified
**Context:** PR #16955: add text python recognition sample

**Code Changes:**
```diff
@@ -1,25 +1,81 @@
+'''
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+    import torch
+    import models.crnn as CRNN
+    model = CRNN(32, 1, 37, 256)
```

Review comment:
`blobFromImage` subtracts mean values first then applies normalization
**File:** samples/dnn/text_detection.py
**Change Type:** modified
**Context:** PR #16955: add text python recognition sample

**Code Changes:**
```diff
@@ -1,25 +1,81 @@
+'''
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+    import torch
+    import models.crnn as CRNN
+    model = CRNN(32, 1, 37, 256)
```

Review comment:
Please import `numpy` befofe `cv2` to avoid potential collisions
**File:** samples/dnn/text_detection.py
**Change Type:** modified
**Context:** PR #16955: add text python recognition sample

**Code Changes:**
```diff
@@ -1,25 +1,81 @@
+'''
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+    import torch
+    import models.crnn as CRNN
+    model = CRNN(32, 1, 37, 256)
```

Review comment:
Yes, that's right
**File:** samples/dnn/text_detection.py
**Change Type:** modified
**Context:** PR #16955: add text python recognition sample

**Code Changes:**
```diff
@@ -1,25 +1,81 @@
+'''
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+    import torch
+    import models.crnn as CRNN
+    model = CRNN(32, 1, 37, 256)
```

Review comment:
Please add a note about OCR model as well. Adding links to download models would be also good.
**File:** samples/dnn/text_detection.py
**Change Type:** modified
**Context:** PR #16955: add text python recognition sample
**Review Line:** 32

**Code Changes:**
```diff
+parser.add_argument('--input',
+                    help='Path to input image or video file. Skip this argument to capture frames from a camera.')
+parser.add_argument('--model', '-m', required=True,
+                    help='Path to a binary .pb file contains trained detector network.')
+parser.add_argument('--ocr', default="crnn.onnx",
+                    help="Path to a binary .pb or .onnx file contains trained recognition network", )
 parser.add_argument('--width', type=int, default=320,
                     help='Preprocess input image by resizing to a specific width. It should be multiple by 32.')
-parser.add_argument('--height',type=int, default=320,
+parser.add_argument('--height', type=int, default=320,
                     help='Preprocess input image by resizing to a specific height. It should be multiple by 32.')
```

Review comment:
Please make OCR model as optional
**File:** samples/dnn/text_detection.py
**Change Type:** modified
**Context:** PR #16955: add text python recognition sample

**Code Changes:**
```diff
@@ -1,25 +1,81 @@
+'''
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+    import torch
+    import models.crnn as CRNN
+    model = CRNN(32, 1, 37, 256)
```

Review comment:
Why it has been changed?
**File:** samples/dnn/text_detection.py
**Change Type:** modified
**Context:** PR #16955: add text python recognition sample

**Code Changes:**
```diff
@@ -1,25 +1,81 @@
+'''
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+    import torch
+    import models.crnn as CRNN
+    model = CRNN(32, 1, 37, 256)
```

Review comment:
please move this cast to `fourPointsTransform`
**File:** samples/dnn/text_detection.py
**Change Type:** modified
**Context:** PR #16955: add text python recognition sample

**Code Changes:**
```diff
@@ -1,25 +1,81 @@
+'''
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+    import torch
+    import models.crnn as CRNN
+    model = CRNN(32, 1, 37, 256)
```

Review comment:
Maybe just ```python if modelRecognition: ``` ?
**File:** samples/dnn/text_detection.py
**Change Type:** modified
**Context:** PR #16955: add text python recognition sample

**Code Changes:**
```diff
@@ -1,25 +1,81 @@
+'''
+    Text detection model: https://github.com/argman/EAST
+    Download link: https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1
+    Text recognition model taken from here: https://github.com/meijieru/crnn.pytorch
+    How to convert from pb to onnx:
+    Using classes from here: https://github.com/meijieru/crnn.pytorch/blob/master/models/crnn.py
+    import torch
+    import models.crnn as CRNN
+    model = CRNN(32, 1, 37, 256)
```

Review comment:
If OCR is disabled we still should draw bounding box.
**File:** samples/python/stitching_detailed.py
**Change Type:** modified
**Context:** PR #16257: Make stitching script more pythonic - ### This pullrequest changes Improve the overall readability and maintainability of the Python exampl...

**Code Changes:**
```diff
@@ -8,114 +8,305 @@
 # Python 2/3 compatibility
 from __future__ import print_function
 
-import numpy as np
+import argparse
+from collections import OrderedDict
+
 import cv2 as cv
+import numpy as np
```

Review comment:
Non-escaped quotes here.
**File:** modules/core/src/ocl.cpp
**Change Type:** modified
**Context:** PR #16608: fixed several problems when running tests on Mac - * failures in ocl_pyrUp * failures in ocl_flip when processing CV_16UC3 or CV_16SC3 data...

**Code Changes:**
```diff
@@ -4705,6 +4705,8 @@ class OpenCLAllocator CV_FINAL : public MatAllocator
             int createFlags = 0, flags0 = 0;
             getBestFlags(ctx, accessFlags, usageFlags, createFlags, flags0);
 
+            bool copyOnMap = (flags0 & UMatData::COPY_ON_MAP) != 0;
+
             cl_context ctx_handle = (cl_context)ctx.ptr();
             int allocatorFlags = 0;
             int tempUMatFlags = 0;
@@ -4764,8 +4766,15 @@ class OpenCLAllocator CV_FINAL : public MatAllocator
```

Review comment:
Do you remember which test triggers that? I have [forced](https://github.com/opencv/opencv/commit/d134b78d4c9031b1e566b7a8c9df6c9073c4b6a5) `hostUnifiedMemory = false`, but [nothing](http://pullrequest.opencv.org/buildbot/builders/precommit_custom_mac/builds/535) is failed on Macs.
**File:** modules/core/src/opencl/flip.cl
**Change Type:** modified
**Context:** PR #16608: fixed several problems when running tests on Mac - * failures in ocl_pyrUp * failures in ocl_flip when processing CV_16UC3 or CV_16SC3 data...
**Review Line:** 58

**Code Changes:**
```diff
+    ((__global T1 *)(addr0))[0] = val0.x; \
+    ((__global T1 *)(addr1))[0] = val1.x; \
+    ((__global T1 *)(addr0))[1] = val0.y; \
+    ((__global T1 *)(addr1))[1] = val1.y; \
+    ((__global T1 *)(addr0))[2] = val0.z; \
+    ((__global T1 *)(addr1))[2] = val1.z
+#else
+#define storepix_2(val0, val1, addr0, addr1) \
+    storepix(val0, addr0); \
+    storepix(val1, addr1)
+#endif
```

Review comment:
This looks strange and may affect performance (especially in interleaved mode). Could you please limit this approach for CV_16U/CV_16S only?
**File:** modules/core/src/ocl.cpp
**Change Type:** modified
**Context:** PR #16608: fixed several problems when running tests on Mac - * failures in ocl_pyrUp * failures in ocl_flip when processing CV_16UC3 or CV_16SC3 data...

**Code Changes:**
```diff
@@ -4705,6 +4705,8 @@ class OpenCLAllocator CV_FINAL : public MatAllocator
             int createFlags = 0, flags0 = 0;
             getBestFlags(ctx, accessFlags, usageFlags, createFlags, flags0);
 
+            bool copyOnMap = (flags0 & UMatData::COPY_ON_MAP) != 0;
+
             cl_context ctx_handle = (cl_context)ctx.ptr();
             int allocatorFlags = 0;
             int tempUMatFlags = 0;
@@ -4764,8 +4766,15 @@ class OpenCLAllocator CV_FINAL : public MatAllocator
```

Review comment:
> On Mac it does not work well. So, where should we put `#ifdef __APPLE__`? Dropping `ACCESS_FAST` flag here does not look like a good idea. AFAIK, it was designed to fail fast if any data copying is required. Please change in `ocl.cpp`: ```.diff -#define CV_OPENCL_TRACE_CHECK 0 +#define CV_OPENCL_TRACE_CHECK 1 ``` and collect stdout dump on problematic test (e.g, which requires this fix). --- BTW, I can't find any place where `ACCESS_FAST` is enabled (including tests). [GitHub results](https://github.com/opencv/opencv/search?q=ACCESS_FAST&type=Code): 1 declaration + 2 checks.
**File:** modules/core/src/persistence.cpp
**Change Type:** modified
**Context:** PR #16488: trying to fix handling file storages with extremely long lines
**Review Line:** 842

**Code Changes:**
```diff
-                size_t sz = strnlen(ptr, maxCount);
-                CV_Assert(sz < (size_t)(maxCount - 1) && "OpenCV persistence doesn't support very long lines");
-            }
-            return ptr;
+            int count = (int)std::min(buffer.size() - ofs - 16, maxCount);
+            char* ptr = getsFromFile( &buffer[ofs], count+1 );
+            if( !ptr )
+                break;
+            int delta = (int)strlen(ptr);
+            ofs += delta;
+            maxCount -= delta;
```

Review comment:
> ` - 16 ` > `count + 1` What is this? Why are these offsets different?
**File:** modules/core/src/persistence.cpp
**Change Type:** modified
**Context:** PR #16488: trying to fix handling file storages with extremely long lines
**Review Line:** 853

**Code Changes:**
```diff
+            if( delta == count )
+                buffer.resize((size_t)(buffer.size()*1.5));
         }
-#endif
-        CV_Error(CV_StsError, "The storage is not opened");
+        return ofs > 0 ? &buffer[0] : 0;
     }
 
     char* gets()
     {
-        char* ptr = this->gets(bufferStart(), (int)(bufferEnd() - bufferStart()));
```

Review comment:
On `.resize()` all previously returned pointers from `.gets()` become invalid. Are you sure that all previously returned pointers are not used anymore? (after next `.gets()` call)
**File:** modules/core/src/persistence.cpp
**Change Type:** modified
**Context:** PR #16488: trying to fix handling file storages with extremely long lines
**Review Line:** 842

**Code Changes:**
```diff
-                size_t sz = strnlen(ptr, maxCount);
-                CV_Assert(sz < (size_t)(maxCount - 1) && "OpenCV persistence doesn't support very long lines");
-            }
-            return ptr;
+            int count = (int)std::min(buffer.size() - ofs - 16, maxCount);
+            char* ptr = getsFromFile( &buffer[ofs], count+1 );
+            if( !ptr )
+                break;
+            int delta = (int)strlen(ptr);
+            ofs += delta;
+            maxCount -= delta;
```

Review comment:
fgets() requires "count+1", because it adds '\0' in the end. but sometimes we need to add '\n' to the end of line. so we might need at least count + 2. "+16" has been added just in case, it's definitely sufficient
**File:** modules/core/src/persistence.cpp
**Change Type:** modified
**Context:** PR #16488: trying to fix handling file storages with extremely long lines
**Review Line:** 853

**Code Changes:**
```diff
+            if( delta == count )
+                buffer.resize((size_t)(buffer.size()*1.5));
         }
-#endif
-        CV_Error(CV_StsError, "The storage is not opened");
+        return ofs > 0 ? &buffer[0] : 0;
     }
 
     char* gets()
     {
-        char* ptr = this->gets(bufferStart(), (int)(bufferEnd() - bufferStart()));
```

Review comment:
yes. I'm sure. when ".gets()" is called by the XML/YAML/JSON parser, it returns the pointer to the read line. The parsers process the line and then call ".gets()" another time to get the next line and so on. Of course, they do not store pointers to the middle of the previously read line, because they consume all the content. ".resize()" can be safely called inside ".gets()".
**File:** modules/core/src/persistence_json.cpp
**Change Type:** modified
**Context:** PR #16488: trying to fix handling file storages with extremely long lines
**Review Line:** 862

**Code Changes:**
```diff
@@ -411,7 +411,10 @@ class JSONParser : public FileStorageParser
         if( *ptr != '"' )
             CV_PARSE_ERROR_CPP( "Key must end with \'\"\'" );
 
-        const char * end = ptr;
+        if( ptr == beg )
+            CV_PARSE_ERROR_CPP( "Key is empty" );
+        value_placeholder = fs->addNode(collection, std::string(beg, (size_t)(ptr - beg)), FileNode::NONE);
+
         ptr++;
         ptr = skipSpaces( ptr );
         if( !ptr || !*ptr )
@@ -420,11 +423,6 @@ class JSONParser : public FileStorageParser
         if( *ptr != ':' )
             CV_PARSE_ERROR_CPP( "Missing \':\' between key and value" );
```

Review comment:
I believe `ptr` should be reassigned above instead: ``` ptr = parseMap(ptr, ...); ... ptr = parseSeq(ptr, ...); ```
**File:** modules/core/src/persistence_json.cpp
**Change Type:** modified
**Context:** PR #16488: trying to fix handling file storages with extremely long lines
**Review Line:** 862

**Code Changes:**
```diff
@@ -411,7 +411,10 @@ class JSONParser : public FileStorageParser
         if( *ptr != '"' )
             CV_PARSE_ERROR_CPP( "Key must end with \'\"\'" );
 
-        const char * end = ptr;
+        if( ptr == beg )
+            CV_PARSE_ERROR_CPP( "Key is empty" );
+        value_placeholder = fs->addNode(collection, std::string(beg, (size_t)(ptr - beg)), FileNode::NONE);
+
         ptr++;
         ptr = skipSpaces( ptr );
         if( !ptr || !*ptr )
@@ -420,11 +423,6 @@ class JSONParser : public FileStorageParser
         if( *ptr != ':' )
             CV_PARSE_ERROR_CPP( "Missing \':\' between key and value" );
```

Review comment:
I believe, those 2 lines just left out by mistake after refactoring. If `ptr` is reassigned, all the tests fail. Simply remove them.
**File:** modules/core/src/persistence.cpp
**Change Type:** modified
**Context:** PR #16488: trying to fix handling file storages with extremely long lines
**Review Line:** 696

**Code Changes:**
```diff
         else
         {
-            const size_t buf_size0 = 1 << 20;
-            size_t buf_size = buf_size0;
+            const size_t buf_size0 = 40;
+            buffer.resize(buf_size0);
             if( mem_mode )
             {
                 strbuf = (char*)filename_or_buf;
@@ -704,8 +703,7 @@ class FileStorage::Impl : public FileStorage_API
             const char* yaml_signature = "%YAML";
```

Review comment:
Do we left this "as is" for merge?
**File:** modules/dnn/src/layers/scale_layer.cpp
**Change Type:** modified
**Context:** PR #16575: Support FlowNet2 model - **Merge with extra:** opencv/opencv_extra#708 relates #16319 Supported layers: - [x] DataAugmentation (1 input, 3 ...

**Code Changes:**
```diff
@@ -296,5 +296,118 @@ Ptr<Layer> ShiftLayer::create(const LayerParams& params)
     return Ptr<ScaleLayer>(new ScaleLayerImpl(scaleParams));
 }
 
+class DataAugmentationLayerImpl CV_FINAL : public DataAugmentationLayer
+{
+public:
+    DataAugmentationLayerImpl(const LayerParams& params)
+    {
+        setParamsFrom(params);
```

Review comment:
finalize is called when network is initialized. Shall we do `num_iter = 0` here to reset the state?
**File:** modules/dnn/src/layers/scale_layer.cpp
**Change Type:** modified
**Context:** PR #16575: Support FlowNet2 model - **Merge with extra:** opencv/opencv_extra#708 relates #16319 Supported layers: - [x] DataAugmentation (1 input, 3 ...

**Code Changes:**
```diff
@@ -296,5 +296,118 @@ Ptr<Layer> ShiftLayer::create(const LayerParams& params)
     return Ptr<ScaleLayer>(new ScaleLayerImpl(scaleParams));
 }
 
+class DataAugmentationLayerImpl CV_FINAL : public DataAugmentationLayer
+{
+public:
+    DataAugmentationLayerImpl(const LayerParams& params)
+    {
+        setParamsFrom(params);
```

Review comment:
Please open blocks from the new line: ```cpp if (mean_per_pixel) { // ... ```