Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
75f4c1ab
Commit
75f4c1ab
authored
Jun 24, 2019
by
Dmitry Kurtaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable some tests for Inference Engine backend
parent
c531e275
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
66 deletions
+30
-66
test_backends.cpp
modules/dnn/test/test_backends.cpp
+2
-1
test_caffe_importer.cpp
modules/dnn/test/test_caffe_importer.cpp
+14
-10
test_layers.cpp
modules/dnn/test/test_layers.cpp
+1
-31
test_onnx_importer.cpp
modules/dnn/test/test_onnx_importer.cpp
+1
-1
test_tf_importer.cpp
modules/dnn/test/test_tf_importer.cpp
+12
-23
No files found.
modules/dnn/test/test_backends.cpp
View file @
75f4c1ab
...
...
@@ -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
)
...
...
modules/dnn/test/test_caffe_importer.cpp
View file @
75f4c1ab
...
...
@@ -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
)
...
...
modules/dnn/test/test_layers.cpp
View file @
75f4c1ab
...
...
@@ -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"
;
...
...
modules/dnn/test/test_onnx_importer.cpp
View file @
75f4c1ab
...
...
@@ -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
);
...
...
modules/dnn/test/test_tf_importer.cpp
View file @
75f4c1ab
...
...
@@ -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
,
6
e-4
,
4e-3
);
runTensorFlowNet
(
"fp16_padding_same"
,
false
,
7
e-4
,
4e-3
);
}
TEST_P
(
Test_TensorFlow_layers
,
defun
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment