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
6ec23048
Commit
6ec23048
authored
Sep 04, 2018
by
Dmitry Kurtaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Myriad tests with batch size > 1
parent
0f0a82b6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
16 deletions
+55
-16
test_halide_layers.cpp
modules/dnn/test/test_halide_layers.cpp
+5
-2
test_layers.cpp
modules/dnn/test/test_layers.cpp
+6
-2
test_precomp.hpp
modules/dnn/test/test_precomp.hpp
+7
-0
test_tf_importer.cpp
modules/dnn/test/test_tf_importer.cpp
+17
-4
test_torch_importer.cpp
modules/dnn/test/test_torch_importer.cpp
+20
-8
No files found.
modules/dnn/test/test_halide_layers.cpp
View file @
6ec23048
...
@@ -93,8 +93,10 @@ TEST_P(Convolution, Accuracy)
...
@@ -93,8 +93,10 @@ TEST_P(Convolution, Accuracy)
Backend
backendId
=
get
<
0
>
(
get
<
7
>
(
GetParam
()));
Backend
backendId
=
get
<
0
>
(
get
<
7
>
(
GetParam
()));
Target
targetId
=
get
<
1
>
(
get
<
7
>
(
GetParam
()));
Target
targetId
=
get
<
1
>
(
get
<
7
>
(
GetParam
()));
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_RELEASE < 2018030000
if
(
backendId
==
DNN_BACKEND_INFERENCE_ENGINE
&&
targetId
==
DNN_TARGET_MYRIAD
)
if
(
backendId
==
DNN_BACKEND_INFERENCE_ENGINE
&&
targetId
==
DNN_TARGET_MYRIAD
)
throw
SkipTestException
(
""
);
throw
SkipTestException
(
"Test is enabled starts from OpenVINO 2018R3"
);
#endif
bool
skipCheck
=
false
;
bool
skipCheck
=
false
;
if
(
cvtest
::
skipUnstableTests
&&
backendId
==
DNN_BACKEND_OPENCV
&&
if
(
cvtest
::
skipUnstableTests
&&
backendId
==
DNN_BACKEND_OPENCV
&&
...
@@ -274,7 +276,8 @@ TEST_P(AvePooling, Accuracy)
...
@@ -274,7 +276,8 @@ TEST_P(AvePooling, Accuracy)
Size
stride
=
get
<
3
>
(
GetParam
());
Size
stride
=
get
<
3
>
(
GetParam
());
Backend
backendId
=
get
<
0
>
(
get
<
4
>
(
GetParam
()));
Backend
backendId
=
get
<
0
>
(
get
<
4
>
(
GetParam
()));
Target
targetId
=
get
<
1
>
(
get
<
4
>
(
GetParam
()));
Target
targetId
=
get
<
1
>
(
get
<
4
>
(
GetParam
()));
if
(
backendId
==
DNN_BACKEND_INFERENCE_ENGINE
&&
targetId
==
DNN_TARGET_MYRIAD
)
if
(
backendId
==
DNN_BACKEND_INFERENCE_ENGINE
&&
targetId
==
DNN_TARGET_MYRIAD
&&
stride
==
Size
(
3
,
2
)
&&
kernel
==
Size
(
3
,
3
)
&&
outSize
!=
Size
(
1
,
1
))
throw
SkipTestException
(
""
);
throw
SkipTestException
(
""
);
const
int
inWidth
=
(
outSize
.
width
-
1
)
*
stride
.
width
+
kernel
.
width
;
const
int
inWidth
=
(
outSize
.
width
-
1
)
*
stride
.
width
+
kernel
.
width
;
...
...
modules/dnn/test/test_layers.cpp
View file @
6ec23048
...
@@ -215,8 +215,10 @@ TEST(Layer_Test_Reshape, Accuracy)
...
@@ -215,8 +215,10 @@ TEST(Layer_Test_Reshape, Accuracy)
TEST_P
(
Test_Caffe_layers
,
BatchNorm
)
TEST_P
(
Test_Caffe_layers
,
BatchNorm
)
{
{
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_RELEASE < 2018030000
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
)
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
)
throw
SkipTestException
(
""
);
throw
SkipTestException
(
"Test is enabled starts from OpenVINO 2018R3"
);
#endif
testLayerUsingCaffeModels
(
"layer_batch_norm"
,
true
);
testLayerUsingCaffeModels
(
"layer_batch_norm"
,
true
);
testLayerUsingCaffeModels
(
"layer_batch_norm_local_stats"
,
true
,
false
);
testLayerUsingCaffeModels
(
"layer_batch_norm_local_stats"
,
true
,
false
);
}
}
...
@@ -729,8 +731,10 @@ INSTANTIATE_TEST_CASE_P(Layer_Test, Crop, Combine(
...
@@ -729,8 +731,10 @@ INSTANTIATE_TEST_CASE_P(Layer_Test, Crop, Combine(
// into the normalization area.
// into the normalization area.
TEST_P
(
Test_Caffe_layers
,
Average_pooling_kernel_area
)
TEST_P
(
Test_Caffe_layers
,
Average_pooling_kernel_area
)
{
{
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_RELEASE < 2018030000
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_MYRIAD
)
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_MYRIAD
)
throw
SkipTestException
(
""
);
throw
SkipTestException
(
"Test is enabled starts from OpenVINO 2018R3"
);
#endif
LayerParams
lp
;
LayerParams
lp
;
lp
.
name
=
"testAvePool"
;
lp
.
name
=
"testAvePool"
;
lp
.
type
=
"Pooling"
;
lp
.
type
=
"Pooling"
;
...
...
modules/dnn/test/test_precomp.hpp
View file @
6ec23048
...
@@ -111,6 +111,7 @@ public:
...
@@ -111,6 +111,7 @@ public:
{
{
throw
SkipTestException
(
"Myriad is not available/disabled in OpenCV"
);
throw
SkipTestException
(
"Myriad is not available/disabled in OpenCV"
);
}
}
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_RELEASE < 2018030000
if
(
inp
&&
ref
&&
inp
->
size
[
0
]
!=
1
)
if
(
inp
&&
ref
&&
inp
->
size
[
0
]
!=
1
)
{
{
// Myriad plugin supports only batch size 1. Slice a single sample.
// Myriad plugin supports only batch size 1. Slice a single sample.
...
@@ -127,6 +128,12 @@ public:
...
@@ -127,6 +128,12 @@ public:
else
else
throw
SkipTestException
(
"Myriad plugin supports only batch size 1"
);
throw
SkipTestException
(
"Myriad plugin supports only batch size 1"
);
}
}
#else
if
(
inp
&&
ref
&&
inp
->
dims
==
4
&&
ref
->
dims
==
4
&&
inp
->
size
[
0
]
!=
1
&&
inp
->
size
[
0
]
!=
ref
->
size
[
0
])
throw
SkipTestException
(
"Inconsistent batch size of input and output blobs for Myriad plugin"
);
#endif
}
}
}
}
...
...
modules/dnn/test/test_tf_importer.cpp
View file @
6ec23048
...
@@ -144,8 +144,10 @@ TEST_P(Test_TensorFlow_layers, eltwise_add_mul)
...
@@ -144,8 +144,10 @@ TEST_P(Test_TensorFlow_layers, eltwise_add_mul)
TEST_P
(
Test_TensorFlow_layers
,
pad_and_concat
)
TEST_P
(
Test_TensorFlow_layers
,
pad_and_concat
)
{
{
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_RELEASE < 2018030000
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_MYRIAD
)
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_MYRIAD
)
throw
SkipTestException
(
""
);
throw
SkipTestException
(
"Test is enabled starts from OpenVINO 2018R3"
);
#endif
runTensorFlowNet
(
"pad_and_concat"
);
runTensorFlowNet
(
"pad_and_concat"
);
}
}
...
@@ -180,8 +182,10 @@ TEST_P(Test_TensorFlow_layers, pooling)
...
@@ -180,8 +182,10 @@ TEST_P(Test_TensorFlow_layers, pooling)
// TODO: fix tests and replace to pooling
// TODO: fix tests and replace to pooling
TEST_P
(
Test_TensorFlow_layers
,
ave_pool_same
)
TEST_P
(
Test_TensorFlow_layers
,
ave_pool_same
)
{
{
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_RELEASE < 2018030000
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_MYRIAD
)
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_MYRIAD
)
throw
SkipTestException
(
""
);
throw
SkipTestException
(
"Test is enabled starts from OpenVINO 2018R3"
);
#endif
runTensorFlowNet
(
"ave_pool_same"
);
runTensorFlowNet
(
"ave_pool_same"
);
}
}
...
@@ -218,9 +222,16 @@ TEST_P(Test_TensorFlow_layers, reshape)
...
@@ -218,9 +222,16 @@ TEST_P(Test_TensorFlow_layers, reshape)
TEST_P
(
Test_TensorFlow_layers
,
flatten
)
TEST_P
(
Test_TensorFlow_layers
,
flatten
)
{
{
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
(
target
==
DNN_TARGET_OPENCL
||
target
==
DNN_TARGET_OPENCL_FP16
))
(
target
==
DNN_TARGET_OPENCL
||
target
==
DNN_TARGET_OPENCL_FP16
||
target
==
DNN_TARGET_MYRIAD
))
throw
SkipTestException
(
""
);
throw
SkipTestException
(
""
);
runTensorFlowNet
(
"flatten"
,
true
);
runTensorFlowNet
(
"flatten"
,
true
);
}
TEST_P
(
Test_TensorFlow_layers
,
unfused_flatten
)
{
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
(
target
==
DNN_TARGET_OPENCL
||
target
==
DNN_TARGET_OPENCL_FP16
))
throw
SkipTestException
(
""
);
runTensorFlowNet
(
"unfused_flatten"
);
runTensorFlowNet
(
"unfused_flatten"
);
runTensorFlowNet
(
"unfused_flatten_unknown_batch"
);
runTensorFlowNet
(
"unfused_flatten_unknown_batch"
);
}
}
...
@@ -500,8 +511,10 @@ TEST_P(Test_TensorFlow_layers, fp16_pad_and_concat)
...
@@ -500,8 +511,10 @@ TEST_P(Test_TensorFlow_layers, fp16_pad_and_concat)
{
{
const
float
l1
=
0.00071
;
const
float
l1
=
0.00071
;
const
float
lInf
=
0.012
;
const
float
lInf
=
0.012
;
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_RELEASE < 2018030000
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_MYRIAD
)
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_MYRIAD
)
throw
SkipTestException
(
""
);
throw
SkipTestException
(
"Test is enabled starts from OpenVINO 2018R3"
);
#endif
runTensorFlowNet
(
"fp16_pad_and_concat"
,
false
,
l1
,
lInf
);
runTensorFlowNet
(
"fp16_pad_and_concat"
,
false
,
l1
,
lInf
);
}
}
...
...
modules/dnn/test/test_torch_importer.cpp
View file @
6ec23048
...
@@ -111,10 +111,10 @@ public:
...
@@ -111,10 +111,10 @@ public:
TEST_P
(
Test_Torch_layers
,
run_convolution
)
TEST_P
(
Test_Torch_layers
,
run_convolution
)
{
{
if
((
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
!=
DNN_TARGET_CPU
)
||
// Output reference values are in range [23.4018, 72.0181]
(
backend
==
DNN_BACKEND_OPENCV
&&
target
==
DNN_TARGET_OPENCL_FP16
))
double
l1
=
(
target
==
DNN_TARGET_OPENCL_FP16
||
target
==
DNN_TARGET_MYRIAD
)
?
0.08
:
default_l1
;
throw
SkipTestException
(
""
)
;
double
lInf
=
(
target
==
DNN_TARGET_OPENCL_FP16
||
target
==
DNN_TARGET_MYRIAD
)
?
0.42
:
default_lInf
;
runTorchNet
(
"net_conv"
,
""
,
false
,
true
);
runTorchNet
(
"net_conv"
,
""
,
false
,
true
,
l1
,
lInf
);
}
}
TEST_P
(
Test_Torch_layers
,
run_pool_max
)
TEST_P
(
Test_Torch_layers
,
run_pool_max
)
...
@@ -129,19 +129,23 @@ TEST_P(Test_Torch_layers, run_pool_ave)
...
@@ -129,19 +129,23 @@ TEST_P(Test_Torch_layers, run_pool_ave)
runTorchNet
(
"net_pool_ave"
);
runTorchNet
(
"net_pool_ave"
);
}
}
TEST_P
(
Test_Torch_layers
,
run_reshape
)
TEST_P
(
Test_Torch_layers
,
run_reshape
_change_batch_size
)
{
{
runTorchNet
(
"net_reshape"
);
runTorchNet
(
"net_reshape"
);
}
TEST_P
(
Test_Torch_layers
,
run_reshape
)
{
runTorchNet
(
"net_reshape_batch"
);
runTorchNet
(
"net_reshape_batch"
);
runTorchNet
(
"net_reshape_channels"
,
""
,
false
,
true
);
runTorchNet
(
"net_reshape_channels"
,
""
,
false
,
true
);
}
}
TEST_P
(
Test_Torch_layers
,
run_reshape_single_sample
)
TEST_P
(
Test_Torch_layers
,
run_reshape_single_sample
)
{
{
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_OPENCL_FP16
)
// Reference output values in range [14.4586, 18.4492].
throw
SkipTestException
(
""
);
runTorchNet
(
"net_reshape_single_sample"
,
""
,
false
,
false
,
runTorchNet
(
"net_reshape_single_sample"
,
""
,
false
,
false
,
(
target
==
DNN_TARGET_MYRIAD
||
target
==
DNN_TARGET_OPENCL_FP16
)
?
0.0052
:
0.0
);
(
target
==
DNN_TARGET_MYRIAD
||
target
==
DNN_TARGET_OPENCL_FP16
)
?
0.0073
:
default_l1
,
(
target
==
DNN_TARGET_MYRIAD
||
target
==
DNN_TARGET_OPENCL_FP16
)
?
0.025
:
default_lInf
);
}
}
TEST_P
(
Test_Torch_layers
,
run_linear
)
TEST_P
(
Test_Torch_layers
,
run_linear
)
...
@@ -154,6 +158,10 @@ TEST_P(Test_Torch_layers, run_linear)
...
@@ -154,6 +158,10 @@ TEST_P(Test_Torch_layers, run_linear)
TEST_P
(
Test_Torch_layers
,
run_concat
)
TEST_P
(
Test_Torch_layers
,
run_concat
)
{
{
runTorchNet
(
"net_concat"
,
"l5_torchMerge"
);
runTorchNet
(
"net_concat"
,
"l5_torchMerge"
);
}
TEST_P
(
Test_Torch_layers
,
run_depth_concat
)
{
runTorchNet
(
"net_depth_concat"
,
""
,
false
,
true
,
0.0
,
runTorchNet
(
"net_depth_concat"
,
""
,
false
,
true
,
0.0
,
target
==
DNN_TARGET_OPENCL_FP16
?
0.021
:
0.0
);
target
==
DNN_TARGET_OPENCL_FP16
?
0.021
:
0.0
);
}
}
...
@@ -207,6 +215,10 @@ TEST_P(Test_Torch_layers, net_conv_gemm_lrn)
...
@@ -207,6 +215,10 @@ TEST_P(Test_Torch_layers, net_conv_gemm_lrn)
TEST_P
(
Test_Torch_layers
,
net_inception_block
)
TEST_P
(
Test_Torch_layers
,
net_inception_block
)
{
{
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_RELEASE == 2018030000
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_MYRIAD
)
throw
SkipTestException
(
""
);
#endif
runTorchNet
(
"net_inception_block"
,
""
,
false
,
true
);
runTorchNet
(
"net_inception_block"
,
""
,
false
,
true
);
}
}
...
...
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