mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 19:20:28 +08:00
gapi(test): use relative error check for Norm/Sum tests
This commit is contained in:
parent
8b7f805642
commit
dd6f5949c2
@ -921,7 +921,8 @@ PERF_TEST_P_(SumPerfTest, TestPerformance)
|
||||
|
||||
// Comparison ////////////////////////////////////////////////////////////
|
||||
{
|
||||
EXPECT_LE(abs(out_sum[0] - out_sum_ocv[0]), tolerance);
|
||||
EXPECT_LE(std::abs(out_sum[0] - out_sum_ocv[0]) / std::max(1.0, std::abs(out_sum_ocv[0])), tolerance)
|
||||
<< "OCV=" << out_sum_ocv[0] << " GAPI=" << out_sum[0];
|
||||
}
|
||||
|
||||
SANITY_CHECK_NOTHING();
|
||||
@ -1041,7 +1042,8 @@ PERF_TEST_P_(NormPerfTest, TestPerformance)
|
||||
|
||||
// Comparison ////////////////////////////////////////////////////////////
|
||||
{
|
||||
EXPECT_LE(abs(out_norm[0] - out_norm_ocv[0]), tolerance);
|
||||
EXPECT_LE(std::abs(out_norm[0] - out_norm_ocv[0]) / std::max(1.0, std::abs(out_norm_ocv[0])), tolerance)
|
||||
<< "OCV=" << out_norm_ocv[0] << " GAPI=" << out_norm[0];
|
||||
}
|
||||
|
||||
SANITY_CHECK_NOTHING();
|
||||
|
@ -703,7 +703,8 @@ TEST_P(SumTest, AccuracyTest)
|
||||
}
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
EXPECT_LE(abs(out_sum[0] - out_sum_ocv[0]), tolerance);
|
||||
EXPECT_LE(std::abs(out_sum[0] - out_sum_ocv[0]) / std::max(1.0, std::abs(out_sum_ocv[0])), tolerance)
|
||||
<< "OCV=" << out_sum_ocv[0] << " GAPI=" << out_sum[0];
|
||||
}
|
||||
}
|
||||
|
||||
@ -802,7 +803,8 @@ TEST_P(NormTest, AccuracyTest)
|
||||
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
{
|
||||
EXPECT_LE(abs(out_norm[0] - out_norm_ocv[0]), tolerance);
|
||||
EXPECT_LE(std::abs(out_norm[0] - out_norm_ocv[0]) / std::max(1.0, std::abs(out_norm_ocv[0])), tolerance)
|
||||
<< "OCV=" << out_norm_ocv[0] << " GAPI=" << out_norm[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -188,7 +188,7 @@ INSTANTIATE_TEST_CASE_P(SumTestCPU, SumTest,
|
||||
cv::Size(640, 480),
|
||||
cv::Size(128, 128)),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(0.0),
|
||||
Values(1e-5),
|
||||
Values(cv::compile_args(CORE_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AbsDiffTestCPU, AbsDiffTest,
|
||||
@ -224,7 +224,7 @@ INSTANTIATE_TEST_CASE_P(NormTestCPU, NormTest,
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480),
|
||||
cv::Size(128, 128)),
|
||||
Values(0.0),
|
||||
Values(1e-5),
|
||||
Values(cv::compile_args(CORE_CPU))),
|
||||
opencv_test::PrintNormCoreParams());
|
||||
|
||||
|
@ -190,7 +190,7 @@ INSTANTIATE_TEST_CASE_P(SumTestGPU, SumTest,
|
||||
cv::Size(640, 480),
|
||||
cv::Size(128, 128)),
|
||||
/*init output matrices or not*/ testing::Bool(),
|
||||
Values(0.5), //Values(0.04), //TODO: too relaxed?
|
||||
Values(1e-3), //TODO: too relaxed?
|
||||
Values(cv::compile_args(CORE_GPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(AbsDiffTestGPU, AbsDiffTest,
|
||||
@ -226,7 +226,7 @@ INSTANTIATE_TEST_CASE_P(NormTestGPU, NormTest,
|
||||
Values(cv::Size(1280, 720),
|
||||
cv::Size(640, 480),
|
||||
cv::Size(128, 128)),
|
||||
Values(0.04), //TODO: too relaxed?
|
||||
Values(1e-3), //TODO: too relaxed?
|
||||
Values(cv::compile_args(CORE_GPU))),
|
||||
opencv_test::PrintNormCoreParams());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user