Issue 1:
System information (version)

OpenCV => 4.1.0

Operating System / Platform => Ubuntu 16.04 x86_64

Compiler => g++ 5.4.0

CPU Atom E3845 + VPU Myriad X

Detailed description

I don't get any significant performance gain by using Intel-Engine on VPU Myriad X for OpenCV-dnn module.

I get the same performance with CPU Atom E3845 and VPU Myriad X:

0.3 FPS with backend=Intel-Engine and target=VPU

0.25 FPS with backend=OpenCV-impl target=CPU

Steps to reproduce

I compiled OpenVINO 2019 R1.

I compiled OpenCV 4.1.0 with Intel's Deep Learning Inference Engine (DL IE) as described here: https://github.com/opencv/opencv/wiki/Intel's-Deep-Learning-Inference-Engine-backend

I modified this example (minor changes, but you can use this original file with the same effect): https://github.com/opencv/opencv/blob/master/samples/dnn/object_detection.cpp

to this: ocv_yolo.cpp that is in attached repr.zip

And run this command:

./ocv_yolo --config=yolov3.cfg --model=yolov3.weights --input=test.mp4 --width=416 --height=416 --classes=coco.names --scale=0.00392 --rgb --backend=2 --targer=3

As known:

backend 0(auto), 1(Halide), 2(Intel-Engine), 3(OpenCV-impl)

target 0(CPU), 1(OpenCL), 2(OpenCV-FP16), 3(VPU)

But I get the same performance

0.3 FPS with backend=2 and target=3

0.25 FPS with backend=3 target=0

While by using OpenVINO example I get about 4.3 FPS on the same model. And it works successfully on Myriad X (VPU) for frozen_yolov3.pb TensorFlow-model that I got from yolov3.cfg/weights Darknet-model with 4.3 FPS by using this example from OpenVINO: https://github.com/opencv/open_model_zoo/blob/master/demos/object_detection_demo_yolov3_async/main.cpp

Source code to reproduce the problem - that uses OpenCV-dnn module for Yolov3 detection, required any test.mp4 file: repr.zip

Also required:

https://pjreddie.com/media/files/yolov3.weights

https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/yolov3.cfg

Issue 2:
System information (version)

OpenCV => 3.4 branch ( 442fdfd ) master branch ( 332c37f )

Operating System / Platform => Ubuntu 18.04/Aarch64/Jetson Xavier , Windows 10 Pro/x86_64

Compiler => GCC 7.3.0/Visual Studio 2015

Detailed description

YUV color conversion test cases from opencv_perf_cudaimgproc fails at sanity check

opencv_perf_cudaimgproc --gtest_filter=*CvtColor*
<snip>
[==========] 174 tests from 2 test cases ran. (17442 ms total)
[ PASSED ] 156 tests.
[ FAILED ] 18 tests, listed below:
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/7, where GetParam() = (1280x720, CV_8U, BGR2YUV)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/8, where GetParam() = (1280x720, CV_8U, YUV2BGR)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/28, where GetParam() = (1280x720, CV_32F, BGR2YUV)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/29, where GetParam() = (1280x720, CV_32F, YUV2BGR)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/40, where GetParam() = (1280x720, CV_32F, Luv2RGB)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/41, where GetParam() = (1280x720, CV_32F, Luv2LRGB)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/49, where GetParam() = (1280x1024, CV_8U, BGR2YUV)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/50, where GetParam() = (1280x1024, CV_8U, YUV2BGR)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/70, where GetParam() = (1280x1024, CV_32F, BGR2YUV)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/71, where GetParam() = (1280x1024, CV_32F, YUV2BGR)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/82, where GetParam() = (1280x1024, CV_32F, Luv2RGB)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/83, where GetParam() = (1280x1024, CV_32F, Luv2LRGB)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/91, where GetParam() = (1920x1080, CV_8U, BGR2YUV)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/92, where GetParam() = (1920x1080, CV_8U, YUV2BGR)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/112, where GetParam() = (1920x1080, CV_32F, BGR2YUV)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/113, where GetParam() = (1920x1080, CV_32F, YUV2BGR)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/124, where GetParam() = (1920x1080, CV_32F, Luv2RGB)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/125, where GetParam() = (1920x1080, CV_32F, Luv2LRGB)

18 FAILED TESTS

I can confirm that opencv_test_cudaimgproc passes with no error

I also added (1920,1080) size in opencv_test_cudaimgproc just in case not to miss any corner cases. Still, opencv_test_cudaimgproc passed with no regression.

This leads me to believe that the cause is now test data it self, which needs to be updated.

I ran opencv_perf_cudaimgproc with perf_write_sanity=true and now making a PR.

opencv_perf_cudaimgproc --gtest_filter=*CvtColor*
<snip>
[==========] 174 tests from 2 test cases ran. (16937 ms total)
[ PASSED ] 168 tests.
[ FAILED ] 6 tests, listed below:
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/40, where GetParam() = (1280x720, CV_32F, Luv2RGB)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/41, where GetParam() = (1280x720, CV_32F, Luv2LRGB)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/82, where GetParam() = (1280x1024, CV_32F, Luv2RGB)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/83, where GetParam() = (1280x1024, CV_32F, Luv2LRGB)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/124, where GetParam() = (1920x1080, CV_32F, Luv2RGB)
[ FAILED ] Sz_Depth_Code_CvtColor.CvtColor/125, where GetParam() = (1920x1080, CV_32F, Luv2LRGB)

6 FAILED TESTS

After updating the test data, performance test of YUV series passed. Now Luv series seems to have different cause, so I'll look in to it afterward.

Steps to reproduce