Skip to content

Commit

Permalink
Alternative solution for blacklisting.
Browse files Browse the repository at this point in the history
  • Loading branch information
asmorkalov committed Dec 10, 2021
1 parent 0aba6f5 commit a3e0543
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 2 deletions.
30 changes: 28 additions & 2 deletions modules/dnn/test/test_onnx_conformance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@


#include "test_precomp.hpp"
#include <set>
#include <string>
#include "npy_blob.hpp"
#include <opencv2/dnn/shape_utils.hpp>

Expand Down Expand Up @@ -1019,13 +1021,37 @@ TEST_P(Test_ONNX_conformance, Layer_Test)
//Backend backend = ...;
//Target target = ...;

ASSERT_FALSE(name.empty());

bool checkLayersFallbacks = true;
bool checkAccuracy = true;

#include "test_onnx_conformance_layer_filter_parser.inl.hpp"
std::set<std::string> parser_black_list {
#include "test_onnx_conformance_layer_parser_blacklist.inl.hpp"
};
if(parser_black_list.find(name) != parser_black_list.end())
{
applyTestTag(CV_TEST_TAG_DNN_SKIP_PARSER, CV_TEST_TAG_DNN_SKIP_ONNX_CONFORMANCE);
}

if (backend == DNN_BACKEND_OPENCV)
{
#include "test_onnx_conformance_layer_filter__opencv.inl.hpp"
std::set<std::string> global_black_list {
#include "test_onnx_conformance_layer_filter_opencv_all_blacklist.inl.hpp"
};
if(global_black_list.find(name) != global_black_list.end())
{
applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCV_BACKEND, CV_TEST_TAG_DNN_SKIP_ONNX_CONFORMANCE);
}

std::set<std::string> fp16_black_list {
#include "test_onnx_conformance_layer_filter_opencv_ocl_fp16_blacklist.inl.hpp"
};
if((target == DNN_TARGET_OPENCL_FP16) && (fp16_black_list.find(name) != fp16_black_list.end()))
{
applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCV_BACKEND, CV_TEST_TAG_DNN_SKIP_OPENCL_FP16, CV_TEST_TAG_DNN_SKIP_ONNX_CONFORMANCE);
}
// TODO: OCL_FP32, CPU
}
#if 0 //def HAVE_HALIDE
else if (backend == DNN_BACKEND_HALIDE)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"test_add_bcast",
"test_averagepool_2d_pads_count_include_pad",
"test_averagepool_2d_precomputed_pads_count_include_pad",
"test_averagepool_2d_same_lower",
"test_cast_FLOAT_to_STRING",
"test_cast_STRING_to_FLOAT",
"test_castlike_FLOAT_to_STRING_expanded",
"test_castlike_STRING_to_FLOAT_expanded",
"test_clip",
"test_clip_default_max",
"test_clip_default_min",
"test_clip_example",
"test_clip_outbounds",
"test_clip_splitbounds",
"test_concat_1d_axis_negative_1",
"test_flatten_axis0",
"test_flatten_axis2",
"test_flatten_axis3",
"test_flatten_negative_axis1",
"test_flatten_negative_axis2",
"test_flatten_negative_axis4",
"test_logsoftmax_default_axis",
"test_maxpool_2d_dilations",
"test_maxpool_2d_same_lower",
"test_maxpool_with_argmax_2d_precomputed_pads",
"test_maxpool_with_argmax_2d_precomputed_strides",
"test_softmax_default_axis",
"test_sub_bcast",
"test_upsample_nearest"
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"test_averagepool_3d_default",
"test_dropout_default_ratio",
"test_globalmaxpool",
"test_globalmaxpool_precomputed",
"test_logsoftmax_large_number",
"test_logsoftmax_large_number_expanded",
"test_maxpool_1d_default",
"test_maxpool_2d_ceil",
"test_maxpool_2d_default",
"test_maxpool_2d_pads",
"test_maxpool_2d_precomputed_pads",
"test_maxpool_2d_precomputed_same_upper",
"test_maxpool_2d_precomputed_strides",
"test_maxpool_2d_same_upper",
"test_maxpool_2d_strides",
"test_maxpool_3d_default",
"test_softmax_large_number",
"test_softmax_large_number_expanded",
"test_split_equal_parts_1d",
"test_split_equal_parts_2d",
"test_split_equal_parts_default_axis"

0 comments on commit a3e0543

Please sign in to comment.