Skip to content

Commit a3e0543

Browse files
committed
Alternative solution for blacklisting.
1 parent 0aba6f5 commit a3e0543

3 files changed

+78
-2
lines changed

modules/dnn/test/test_onnx_conformance.cpp

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55

66
#include "test_precomp.hpp"
7+
#include <set>
8+
#include <string>
79
#include "npy_blob.hpp"
810
#include <opencv2/dnn/shape_utils.hpp>
911

@@ -1019,13 +1021,37 @@ TEST_P(Test_ONNX_conformance, Layer_Test)
10191021
//Backend backend = ...;
10201022
//Target target = ...;
10211023

1024+
ASSERT_FALSE(name.empty());
1025+
10221026
bool checkLayersFallbacks = true;
10231027
bool checkAccuracy = true;
10241028

1025-
#include "test_onnx_conformance_layer_filter_parser.inl.hpp"
1029+
std::set<std::string> parser_black_list {
1030+
#include "test_onnx_conformance_layer_parser_blacklist.inl.hpp"
1031+
};
1032+
if(parser_black_list.find(name) != parser_black_list.end())
1033+
{
1034+
applyTestTag(CV_TEST_TAG_DNN_SKIP_PARSER, CV_TEST_TAG_DNN_SKIP_ONNX_CONFORMANCE);
1035+
}
1036+
10261037
if (backend == DNN_BACKEND_OPENCV)
10271038
{
1028-
#include "test_onnx_conformance_layer_filter__opencv.inl.hpp"
1039+
std::set<std::string> global_black_list {
1040+
#include "test_onnx_conformance_layer_filter_opencv_all_blacklist.inl.hpp"
1041+
};
1042+
if(global_black_list.find(name) != global_black_list.end())
1043+
{
1044+
applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCV_BACKEND, CV_TEST_TAG_DNN_SKIP_ONNX_CONFORMANCE);
1045+
}
1046+
1047+
std::set<std::string> fp16_black_list {
1048+
#include "test_onnx_conformance_layer_filter_opencv_ocl_fp16_blacklist.inl.hpp"
1049+
};
1050+
if((target == DNN_TARGET_OPENCL_FP16) && (fp16_black_list.find(name) != fp16_black_list.end()))
1051+
{
1052+
applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCV_BACKEND, CV_TEST_TAG_DNN_SKIP_OPENCL_FP16, CV_TEST_TAG_DNN_SKIP_ONNX_CONFORMANCE);
1053+
}
1054+
// TODO: OCL_FP32, CPU
10291055
}
10301056
#if 0 //def HAVE_HALIDE
10311057
else if (backend == DNN_BACKEND_HALIDE)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"test_add_bcast",
2+
"test_averagepool_2d_pads_count_include_pad",
3+
"test_averagepool_2d_precomputed_pads_count_include_pad",
4+
"test_averagepool_2d_same_lower",
5+
"test_cast_FLOAT_to_STRING",
6+
"test_cast_STRING_to_FLOAT",
7+
"test_castlike_FLOAT_to_STRING_expanded",
8+
"test_castlike_STRING_to_FLOAT_expanded",
9+
"test_clip",
10+
"test_clip_default_max",
11+
"test_clip_default_min",
12+
"test_clip_example",
13+
"test_clip_outbounds",
14+
"test_clip_splitbounds",
15+
"test_concat_1d_axis_negative_1",
16+
"test_flatten_axis0",
17+
"test_flatten_axis2",
18+
"test_flatten_axis3",
19+
"test_flatten_negative_axis1",
20+
"test_flatten_negative_axis2",
21+
"test_flatten_negative_axis4",
22+
"test_logsoftmax_default_axis",
23+
"test_maxpool_2d_dilations",
24+
"test_maxpool_2d_same_lower",
25+
"test_maxpool_with_argmax_2d_precomputed_pads",
26+
"test_maxpool_with_argmax_2d_precomputed_strides",
27+
"test_softmax_default_axis",
28+
"test_sub_bcast",
29+
"test_upsample_nearest"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"test_averagepool_3d_default",
2+
"test_dropout_default_ratio",
3+
"test_globalmaxpool",
4+
"test_globalmaxpool_precomputed",
5+
"test_logsoftmax_large_number",
6+
"test_logsoftmax_large_number_expanded",
7+
"test_maxpool_1d_default",
8+
"test_maxpool_2d_ceil",
9+
"test_maxpool_2d_default",
10+
"test_maxpool_2d_pads",
11+
"test_maxpool_2d_precomputed_pads",
12+
"test_maxpool_2d_precomputed_same_upper",
13+
"test_maxpool_2d_precomputed_strides",
14+
"test_maxpool_2d_same_upper",
15+
"test_maxpool_2d_strides",
16+
"test_maxpool_3d_default",
17+
"test_softmax_large_number",
18+
"test_softmax_large_number_expanded",
19+
"test_split_equal_parts_1d",
20+
"test_split_equal_parts_2d",
21+
"test_split_equal_parts_default_axis"

0 commit comments

Comments
 (0)