feat: 切换后端至PaddleOCR-NCNN,切换工程为CMake
1.项目后端整体迁移至PaddleOCR-NCNN算法,已通过基本的兼容性测试 2.工程改为使用CMake组织,后续为了更好地兼容第三方库,不再提供QMake工程 3.重整权利声明文件,重整代码工程,确保最小化侵权风险 Log: 切换后端至PaddleOCR-NCNN,切换工程为CMake Change-Id: I4d5d2c5d37505a4a24b389b1a4c5d12f17bfa38c
This commit is contained in:
75
3rdparty/opencv-4.5.4/modules/gapi/test/gapi_compile_args_tests.cpp
vendored
Normal file
75
3rdparty/opencv-4.5.4/modules/gapi/test/gapi_compile_args_tests.cpp
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
// This file is part of OpenCV project.
|
||||
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||
// of this distribution and at http://opencv.org/license.html.
|
||||
//
|
||||
// Copyright (C) 2020 Intel Corporation
|
||||
|
||||
|
||||
#include "test_precomp.hpp"
|
||||
|
||||
namespace opencv_test
|
||||
{
|
||||
struct CustomArg
|
||||
{
|
||||
int number;
|
||||
};
|
||||
}
|
||||
|
||||
namespace cv
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
template<> struct CompileArgTag<opencv_test::CustomArg>
|
||||
{
|
||||
static const char* tag() { return "org.opencv.test.custom_arg"; }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace opencv_test
|
||||
{
|
||||
namespace
|
||||
{
|
||||
G_TYPED_KERNEL(GTestOp, <GMat(GMat)>, "org.opencv.test.test_op")
|
||||
{
|
||||
static GMatDesc outMeta(GMatDesc in) { return in; }
|
||||
};
|
||||
|
||||
GAPI_OCV_KERNEL(GOCVTestOp, GTestOp)
|
||||
{
|
||||
static void run(const cv::Mat &/* in */, cv::Mat &/* out */) { }
|
||||
};
|
||||
} // anonymous namespace
|
||||
|
||||
TEST(GetCompileArgTest, PredefinedArgs)
|
||||
{
|
||||
cv::gapi::GKernelPackage pkg = cv::gapi::kernels<GOCVTestOp>();
|
||||
cv::GCompileArg arg0 { pkg },
|
||||
arg1 { cv::gapi::use_only { pkg } },
|
||||
arg2 { cv::graph_dump_path { "fake_path" } };
|
||||
|
||||
GCompileArgs compArgs { arg0, arg1, arg2 };
|
||||
|
||||
auto kernelPkgOpt = cv::gapi::getCompileArg<cv::gapi::GKernelPackage>(compArgs);
|
||||
GAPI_Assert(kernelPkgOpt.has_value());
|
||||
EXPECT_NO_THROW(kernelPkgOpt.value().lookup("org.opencv.test.test_op"));
|
||||
|
||||
auto hasUseOnlyOpt = cv::gapi::getCompileArg<cv::gapi::use_only>(compArgs);
|
||||
GAPI_Assert(hasUseOnlyOpt.has_value());
|
||||
EXPECT_NO_THROW(hasUseOnlyOpt.value().pkg.lookup("org.opencv.test.test_op"));
|
||||
|
||||
auto dumpInfoOpt = cv::gapi::getCompileArg<cv::graph_dump_path>(compArgs);
|
||||
GAPI_Assert(dumpInfoOpt.has_value());
|
||||
EXPECT_EQ("fake_path", dumpInfoOpt.value().m_dump_path);
|
||||
}
|
||||
|
||||
TEST(GetCompileArg, CustomArgs)
|
||||
{;
|
||||
cv::GCompileArgs compArgs{ GCompileArg { CustomArg { 7 } } };
|
||||
|
||||
auto customArgOpt = cv::gapi::getCompileArg<CustomArg>(compArgs);
|
||||
GAPI_Assert(customArgOpt.has_value());
|
||||
EXPECT_EQ(7, customArgOpt.value().number);
|
||||
}
|
||||
} // namespace opencv_test
|
Reference in New Issue
Block a user