Merge remote-tracking branch 'upstream/3.4' into merge-3.4
authorAlexander Alekhin <alexander.a.alekhin@gmail.com>
Mon, 18 May 2020 17:50:16 +0000 (17:50 +0000)
committerAlexander Alekhin <alexander.a.alekhin@gmail.com>
Mon, 18 May 2020 17:50:16 +0000 (17:50 +0000)
15 files changed:
1  2 
modules/core/include/opencv2/core/private.hpp
modules/dnn/src/layers/batch_norm_layer.cpp
modules/dnn/src/layers/resize_layer.cpp
modules/dnn/src/layers/scale_layer.cpp
modules/dnn/src/tensorflow/tf_graph_simplifier.cpp
modules/dnn/src/tensorflow/tf_importer.cpp
modules/dnn/test/test_common.impl.hpp
modules/dnn/test/test_darknet_importer.cpp
modules/dnn/test/test_layers.cpp
modules/dnn/test/test_onnx_importer.cpp
modules/dnn/test/test_tf_importer.cpp
modules/imgcodecs/CMakeLists.txt
modules/imgproc/CMakeLists.txt
modules/videoio/src/cap_avfoundation.mm
samples/_winpack_build_sample.cmd

@@@ -231,32 -221,9 +231,32 @@@ public
      }
  #endif  // HAVE_DNN_NGRAPH
  
 +
 +#ifdef HAVE_CUDA
 +    Ptr<BackendNode> initCUDA(
 +        void *context_,
 +        const std::vector<Ptr<BackendWrapper>>& inputs,
 +        const std::vector<Ptr<BackendWrapper>>& outputs
 +    ) override
 +    {
 +        auto context = reinterpret_cast<csl::CSLContext*>(context_);
 +
 +        cuda4dnn::InterpolationType itype;
 +        if (interpolation == "nearest")
 +            itype = InterpolationType::NEAREST_NEIGHBOUR;
 +        else if (interpolation == "bilinear")
 +            itype = InterpolationType::BILINEAR;
 +        else
 +            CV_Error(Error::StsNotImplemented, "Requested interpolation mode is not available in resize layer.");
 +
 +        return make_cuda_node<cuda4dnn::ResizeOp>(preferableTarget, std::move(context->stream), itype, scaleHeight, scaleWidth);
 +    }
 +#endif
 +
 +
  protected:
      int outWidth, outHeight;
-     const int zoomFactorWidth, zoomFactorHeight;
+     const float zoomFactorWidth, zoomFactorHeight;
      String interpolation;
      float scaleWidth, scaleHeight;
      bool alignCorners;
Simple merge
@@@ -481,17 -463,9 +481,17 @@@ TEST_P(Test_Darknet_nets, YOLOv3
                                      1, 2,  0.989633f, 0.450719f, 0.463353f, 0.496305f, 0.522258f,  // a car
                                      1, 2,  0.997412f, 0.647584f, 0.459939f, 0.821038f, 0.663947f); // a car
  
 -    double scoreDiff = (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD) ? 0.006 : 8e-5;
 -    double iouDiff = (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD) ? 0.042 : 3e-4;
 -
 +    double scoreDiff = 8e-5, iouDiff = 3e-4;
 +    if (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD)
 +    {
 +        scoreDiff = 0.006;
-         iouDiff = 0.018;
++        iouDiff = 0.042;
 +    }
 +    else if (target == DNN_TARGET_CUDA_FP16)
 +    {
 +        scoreDiff = 0.04;
 +        iouDiff = 0.03;
 +    }
      std::string config_file = "yolov3.cfg";
      std::string weights_file = "yolov3.weights";
  
Simple merge
Simple merge
Simple merge
@@@ -10,4 -10,11 +10,10 @@@ ocv_add_dispatched_file(median_blur SSE
  ocv_add_dispatched_file(morph SSE2 SSE4_1 AVX2)
  ocv_add_dispatched_file(smooth SSE2 SSE4_1 AVX2)
  ocv_add_dispatched_file(sumpixels SSE2 AVX2 AVX512_SKX)
 -ocv_add_dispatched_file(undistort SSE2 AVX2)
  ocv_define_module(imgproc opencv_core WRAP java python js)
+ ocv_check_environment_variables(OPENCV_IPP_GAUSSIAN_BLUR)
+ option(OPENCV_IPP_GAUSSIAN_BLUR "Enable IPP optimizations for GaussianBlur (+8Mb in binary size)" OFF)
+ if(OPENCV_IPP_GAUSSIAN_BLUR)
+   ocv_append_source_file_compile_definitions(${CMAKE_CURRENT_SOURCE_DIR}/src/smooth.dispatch.cpp "ENABLE_IPP_GAUSSIAN_BLUR=1")
+ endif()
Simple merge