mirror of
https://github.com/opencv/opencv.git
synced 2024-11-28 21:20:18 +08:00
Merge pull request #14880 from dkurt:dnn_ie_tests
This commit is contained in:
commit
6dea8309c5
@ -383,7 +383,8 @@ TEST_P(DNNTestNetwork, DenseNet_121)
|
||||
l1 = 0.1; lInf = 0.6;
|
||||
}
|
||||
processNet("dnn/DenseNet_121.caffemodel", "dnn/DenseNet_121.prototxt", Size(224, 224), "", "", l1, lInf);
|
||||
expectNoFallbacksFromIE(net);
|
||||
if (target != DNN_TARGET_MYRIAD || getInferenceEngineVPUType() != CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X)
|
||||
expectNoFallbacksFromIE(net);
|
||||
}
|
||||
|
||||
TEST_P(DNNTestNetwork, FastNeuralStyle_eccv16)
|
||||
|
@ -286,19 +286,22 @@ TEST_P(Reproducibility_MobileNet_SSD, Accuracy)
|
||||
zerosOut = zerosOut.reshape(1, zerosOut.total() / 7);
|
||||
|
||||
const int numDetections = zerosOut.rows;
|
||||
ASSERT_NE(numDetections, 0);
|
||||
for (int i = 0; i < numDetections; ++i)
|
||||
// TODO: fix it
|
||||
if (targetId != DNN_TARGET_MYRIAD ||
|
||||
getInferenceEngineVPUType() != CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X)
|
||||
{
|
||||
float confidence = zerosOut.ptr<float>(i)[2];
|
||||
ASSERT_EQ(confidence, 0);
|
||||
ASSERT_NE(numDetections, 0);
|
||||
for (int i = 0; i < numDetections; ++i)
|
||||
{
|
||||
float confidence = zerosOut.ptr<float>(i)[2];
|
||||
ASSERT_EQ(confidence, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// There is something wrong with Reshape layer in Myriad plugin and
|
||||
// regression with DLIE/OCL_FP16 target.
|
||||
// There is something wrong with Reshape layer in Myriad plugin.
|
||||
if (backendId == DNN_BACKEND_INFERENCE_ENGINE)
|
||||
{
|
||||
if ((targetId == DNN_TARGET_MYRIAD && getInferenceEngineVPUType() == CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_2) ||
|
||||
targetId == DNN_TARGET_OPENCL_FP16)
|
||||
if (targetId == DNN_TARGET_MYRIAD || targetId == DNN_TARGET_OPENCL_FP16)
|
||||
return;
|
||||
}
|
||||
|
||||
@ -465,7 +468,7 @@ TEST_P(Test_Caffe_nets, Colorization)
|
||||
double lInf = (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD) ? 5.3 : 3e-3;
|
||||
if (target == DNN_TARGET_MYRIAD && getInferenceEngineVPUType() == CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X)
|
||||
{
|
||||
l1 = 0.6; lInf = 15;
|
||||
l1 = 0.5; lInf = 11;
|
||||
}
|
||||
normAssert(out, ref, "", l1, lInf);
|
||||
expectNoFallbacksFromIE(net);
|
||||
@ -500,7 +503,8 @@ TEST_P(Test_Caffe_nets, DenseNet_121)
|
||||
l1 = 0.11; lInf = 0.5;
|
||||
}
|
||||
normAssert(out, ref, "", l1, lInf);
|
||||
expectNoFallbacksFromIE(net);
|
||||
if (target != DNN_TARGET_MYRIAD || getInferenceEngineVPUType() != CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X)
|
||||
expectNoFallbacksFromIE(net);
|
||||
}
|
||||
|
||||
TEST(Test_Caffe, multiple_inputs)
|
||||
|
@ -141,8 +141,6 @@ TEST_P(Test_Caffe_layers, Convolution)
|
||||
|
||||
TEST_P(Test_Caffe_layers, DeConvolution)
|
||||
{
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_CPU)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE); // TODO IE_CPU
|
||||
testLayerUsingCaffeModels("layer_deconvolution", true, false);
|
||||
}
|
||||
|
||||
@ -246,15 +244,8 @@ TEST_P(Test_Caffe_layers, Concat)
|
||||
|
||||
TEST_P(Test_Caffe_layers, Fused_Concat)
|
||||
{
|
||||
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_GE(2019010000)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE) // Test is disabled for DLIE due negative_slope parameter
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE, CV_TEST_TAG_DNN_SKIP_IE_2019R1, CV_TEST_TAG_DNN_SKIP_IE_2019R1_1);
|
||||
#endif
|
||||
|
||||
#if defined(INF_ENGINE_RELEASE)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && (target == DNN_TARGET_OPENCL || target == DNN_TARGET_OPENCL_FP16))
|
||||
applyTestTag(target == DNN_TARGET_OPENCL ? CV_TEST_TAG_DNN_SKIP_IE_OPENCL : CV_TEST_TAG_DNN_SKIP_IE_OPENCL_FP16);
|
||||
#endif
|
||||
|
||||
checkBackend();
|
||||
|
||||
@ -319,26 +310,6 @@ TEST_P(Test_Caffe_layers, layer_prelu_fc)
|
||||
testLayerUsingCaffeModels("layer_prelu_fc", true, false, l1, lInf);
|
||||
}
|
||||
|
||||
//template<typename XMat>
|
||||
//static void test_Layer_Concat()
|
||||
//{
|
||||
// Matx21f a(1.f, 1.f), b(2.f, 2.f), c(3.f, 3.f);
|
||||
// std::vector<Blob> res(1), src = { Blob(XMat(a)), Blob(XMat(b)), Blob(XMat(c)) };
|
||||
// Blob ref(XMat(Matx23f(1.f, 2.f, 3.f, 1.f, 2.f, 3.f)));
|
||||
//
|
||||
// runLayer(ConcatLayer::create(1), src, res);
|
||||
// normAssert(ref, res[0]);
|
||||
//}
|
||||
//TEST(Layer_Concat, Accuracy)
|
||||
//{
|
||||
// test_Layer_Concat<Mat>());
|
||||
//}
|
||||
//OCL_TEST(Layer_Concat, Accuracy)
|
||||
//{
|
||||
// OCL_ON(test_Layer_Concat<Mat>());
|
||||
// );
|
||||
//}
|
||||
|
||||
TEST_P(Test_Caffe_layers, Reshape_Split_Slice)
|
||||
{
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE)
|
||||
@ -774,9 +745,8 @@ TEST_P(Test_Caffe_layers, Average_pooling_kernel_area)
|
||||
// Test PriorBoxLayer in case of no aspect ratios (just squared proposals).
|
||||
TEST_P(Test_Caffe_layers, PriorBox_squares)
|
||||
{
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD);
|
||||
|
||||
LayerParams lp;
|
||||
lp.name = "testPriorBox";
|
||||
lp.type = "PriorBox";
|
||||
|
@ -225,7 +225,7 @@ TEST_P(Test_ONNX_layers, Multiplication)
|
||||
|
||||
TEST_P(Test_ONNX_layers, Constant)
|
||||
{
|
||||
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_LE(2018050000)
|
||||
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2018050000)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD
|
||||
&& getInferenceEngineVPUType() == CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD_X, CV_TEST_TAG_DNN_SKIP_IE_2018R5);
|
||||
|
@ -151,12 +151,6 @@ TEST_P(Test_TensorFlow_layers, padding)
|
||||
|
||||
TEST_P(Test_TensorFlow_layers, padding_same)
|
||||
{
|
||||
#if defined(INF_ENGINE_RELEASE)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD
|
||||
&& getInferenceEngineVPUType() == CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X
|
||||
)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD_X);
|
||||
#endif
|
||||
// Reference output values are in range [0.0006, 2.798]
|
||||
runTensorFlowNet("padding_same");
|
||||
}
|
||||
@ -432,14 +426,6 @@ TEST_P(Test_TensorFlow_nets, Inception_v2_SSD)
|
||||
TEST_P(Test_TensorFlow_nets, MobileNet_v1_SSD)
|
||||
{
|
||||
checkBackend();
|
||||
|
||||
#if defined(INF_ENGINE_RELEASE)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD
|
||||
&& getInferenceEngineVPUType() == CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X
|
||||
)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD_X);
|
||||
#endif
|
||||
|
||||
std::string proto = findDataFile("dnn/ssd_mobilenet_v1_coco_2017_11_17.pbtxt");
|
||||
std::string model = findDataFile("dnn/ssd_mobilenet_v1_coco_2017_11_17.pb", false);
|
||||
|
||||
@ -456,7 +442,17 @@ TEST_P(Test_TensorFlow_nets, MobileNet_v1_SSD)
|
||||
Mat ref = blobFromNPY(findDataFile("dnn/tensorflow/ssd_mobilenet_v1_coco_2017_11_17.detection_out.npy"));
|
||||
float scoreDiff = (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD) ? 7e-3 : 1.5e-5;
|
||||
float iouDiff = (target == DNN_TARGET_OPENCL_FP16 || target == DNN_TARGET_MYRIAD) ? 0.012 : 1e-3;
|
||||
normAssertDetections(ref, out, "", 0.3, scoreDiff, iouDiff);
|
||||
float detectionConfThresh = (target == DNN_TARGET_MYRIAD) ? 0.35 : 0.3;
|
||||
|
||||
#if defined(INF_ENGINE_RELEASE)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD
|
||||
&& getInferenceEngineVPUType() == CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X
|
||||
)
|
||||
scoreDiff = 0.061;
|
||||
iouDiff = 0.12;
|
||||
detectionConfThresh = 0.36;
|
||||
#endif
|
||||
normAssertDetections(ref, out, "", detectionConfThresh, scoreDiff, iouDiff);
|
||||
expectNoFallbacksFromIE(net);
|
||||
}
|
||||
|
||||
@ -648,15 +644,8 @@ TEST_P(Test_TensorFlow_layers, fp16_weights)
|
||||
|
||||
TEST_P(Test_TensorFlow_layers, fp16_padding_same)
|
||||
{
|
||||
#if defined(INF_ENGINE_RELEASE)
|
||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE && target == DNN_TARGET_MYRIAD
|
||||
&& getInferenceEngineVPUType() == CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X
|
||||
)
|
||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD_X);
|
||||
#endif
|
||||
|
||||
// Reference output values are in range [-3.504, -0.002]
|
||||
runTensorFlowNet("fp16_padding_same", false, 6e-4, 4e-3);
|
||||
runTensorFlowNet("fp16_padding_same", false, 7e-4, 4e-3);
|
||||
}
|
||||
|
||||
TEST_P(Test_TensorFlow_layers, defun)
|
||||
|
Loading…
Reference in New Issue
Block a user