From ee3740af0013ff65483585b9b6f9f6a5bee73e7c Mon Sep 17 00:00:00 2001 From: zihaomu Date: Mon, 13 Mar 2023 22:16:51 +0800 Subject: [PATCH] move global skip out of if loop, and add opencv_deny_list --- modules/dnn/test/test_common.hpp | 1 + modules/dnn/test/test_onnx_conformance.cpp | 15 ++++++++++++++- ...nformance_layer_filter_opencv_denylist.inl.hpp | 0 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 modules/dnn/test/test_onnx_conformance_layer_filter_opencv_denylist.inl.hpp diff --git a/modules/dnn/test/test_common.hpp b/modules/dnn/test/test_common.hpp index df93e50c91..e3c7a553f8 100644 --- a/modules/dnn/test/test_common.hpp +++ b/modules/dnn/test/test_common.hpp @@ -47,6 +47,7 @@ #define CV_TEST_TAG_DNN_SKIP_ONNX_CONFORMANCE "dnn_skip_onnx_conformance" #define CV_TEST_TAG_DNN_SKIP_PARSER "dnn_skip_parser" +#define CV_TEST_TAG_DNN_SKIP_GLOBAL "dnn_skip_global" #define CV_TEST_TAG_DNN_SKIP_TIMVX "dnn_skip_timvx" #define CV_TEST_TAG_DNN_SKIP_CANN "dnn_skip_cann" diff --git a/modules/dnn/test/test_onnx_conformance.cpp b/modules/dnn/test/test_onnx_conformance.cpp index fc766c2b81..8f24fdf135 100644 --- a/modules/dnn/test/test_onnx_conformance.cpp +++ b/modules/dnn/test/test_onnx_conformance.cpp @@ -937,6 +937,7 @@ public: static std::set parser_deny_list; static std::set global_deny_list; + static std::set opencv_deny_list; static std::set opencl_fp16_deny_list; static std::set opencl_deny_list; static std::set cpu_deny_list; @@ -1001,6 +1002,10 @@ public: #include "test_onnx_conformance_layer_filter_opencv_all_denylist.inl.hpp" }; + opencv_deny_list = { + #include "test_onnx_conformance_layer_filter_opencv_denylist.inl.hpp" + }; + opencl_fp16_deny_list = { #include "test_onnx_conformance_layer_filter_opencv_ocl_fp16_denylist.inl.hpp" }; @@ -1036,6 +1041,7 @@ public: std::set Test_ONNX_conformance::parser_deny_list; std::set Test_ONNX_conformance::global_deny_list; +std::set Test_ONNX_conformance::opencv_deny_list; std::set Test_ONNX_conformance::opencl_fp16_deny_list; std::set Test_ONNX_conformance::opencl_deny_list; std::set Test_ONNX_conformance::cpu_deny_list; @@ -1057,14 +1063,21 @@ TEST_P(Test_ONNX_conformance, Layer_Test) bool checkLayersFallbacks = true; bool checkAccuracy = true; + // SKIP when the test case is in the parser deny list. if (parser_deny_list.find(name) != parser_deny_list.end()) { applyTestTag(CV_TEST_TAG_DNN_SKIP_PARSER, CV_TEST_TAG_DNN_SKIP_ONNX_CONFORMANCE); } + // SKIP when the test case is in the global deny list. + if (global_deny_list.find(name) != global_deny_list.end()) + { + applyTestTag(CV_TEST_TAG_DNN_SKIP_GLOBAL, CV_TEST_TAG_DNN_SKIP_ONNX_CONFORMANCE); + } + if (backend == DNN_BACKEND_OPENCV) { - if (global_deny_list.find(name) != global_deny_list.end()) + if (opencv_deny_list.find(name) != opencv_deny_list.end()) { applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCV_BACKEND, CV_TEST_TAG_DNN_SKIP_ONNX_CONFORMANCE); } diff --git a/modules/dnn/test/test_onnx_conformance_layer_filter_opencv_denylist.inl.hpp b/modules/dnn/test/test_onnx_conformance_layer_filter_opencv_denylist.inl.hpp new file mode 100644 index 0000000000..e69de29bb2