Merge remote-tracking branch 'upstream/3.4' into merge-3.4
authorAlexander Alekhin <alexander.a.alekhin@gmail.com>
Sat, 5 Mar 2022 19:41:20 +0000 (19:41 +0000)
committerAlexander Alekhin <alexander.a.alekhin@gmail.com>
Sat, 5 Mar 2022 19:46:28 +0000 (19:46 +0000)
1  2 
modules/dnn/src/layers/slice_layer.cpp
modules/dnn/src/onnx/onnx_importer.cpp
modules/dnn/src/tensorflow/tf_importer.cpp
modules/dnn/src/torch/torch_importer.cpp
modules/dnn/test/test_layers.cpp
modules/python/test/test_misc.py

@@@ -1273,9 -1039,8 +1273,9 @@@ void ONNXImporter::parseSlice(LayerPara
          CV_Assert(starts.size() == ends.size());
  
          if (axis > 0) {
 +            CV_CheckLE(axis, 1024, "Slice layer can't have more than 1024 axes"); // arbitrary limit
              begin.resize(axis, 0);
-             end.resize(axis, -1);
+             end.resize(axis, INT_MAX);
          }
          for (int i = 0; i < starts.size(); ++i)
          {
Simple merge
@@@ -641,6 -626,25 +641,16 @@@ class Arguments(NewOpenCVTests)
                          "global module")
          self.assertEqual(cv.ml.Boost, cv.ml_Boost,
                           msg="Classes from submodules and global module don't refer "
 -    def test_inner_class_has_global_alias(self):
 -        self.assertTrue(hasattr(cv.SimpleBlobDetector, "Params"),
 -                        msg="Class is not registered as inner class")
 -        self.assertEqual(cv.SimpleBlobDetector.Params, cv.SimpleBlobDetector_Params,
 -                        msg="Inner class and class in global module don't refer "
 -                        "to the same type")
 -        self.assertTrue(hasattr(cv, "SimpleBlobDetector_Params"),
 -                        msg="Inner class doesn't have alias in the global module")
 -
+                          "to the same type")
+     def test_class_from_submodule_has_global_alias(self):
+         self.assertTrue(hasattr(cv.ml, "Boost"),
+                         msg="Class is not registered in the submodule")
+         self.assertTrue(hasattr(cv, "ml_Boost"),
+                         msg="Class from submodule doesn't have alias in the "
+                         "global module")
+         self.assertEqual(cv.ml.Boost, cv.ml_Boost,
+                          msg="Classes from submodules and global module don't refer "
                           "to the same type")
  
      def test_inner_class_has_global_alias(self):