Skip to content

arm64 fix: Replaced float value strong equal checks with check with tolerance#19128

Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom
asmorkalov:as/gapi_phase_tolerance
Dec 18, 2020
Merged

arm64 fix: Replaced float value strong equal checks with check with tolerance#19128
opencv-pushbot merged 1 commit intoopencv:masterfrom
asmorkalov:as/gapi_phase_tolerance

Conversation

@asmorkalov
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov commented Dec 15, 2020

Fixes: #19117

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@asmorkalov asmorkalov added platform: arm ARM boards related issues: RPi, NVIDIA TK/TX, etc category: g-api / gapi labels Dec 15, 2020
@asmorkalov asmorkalov requested a review from dmatveev December 15, 2020 15:11
// FIXME: use a comparison functor instead (after enabling OpenCL)
{
EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF));
EXPECT_LT(cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF), 4e-6);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm in google tests' EXPECT(a,b) a is a golden reference usually, does this mean it should be EXPECT_GT(4e-6, norm..)) ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rule is for _EQ only due to output messages (LT,LE,GT,GE doesn't require that)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not EXPECT_FLOAT_EQ(0, cvtest::norm()) / EXPECT_NEAR() ? 4e-6 looks like a magic number to me.

// FIXME: use a comparison functor instead (after enabling OpenCL)
{
EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF));
EXPECT_LT(cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF), 4e-6);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put this ARM check under:

#if defined(__aarch64__) || defined(__arm__)

guard and keep original check "as is".

BTW, almost all failures on ARM64 are about the "Fluid" backend.
CPU (OpenCV) backend results should stay the same.
It make sense to G-API team implement the "FIXME" comment about the comparison functor as test parameter later.

// FIXME: use a comparison functor instead (after enabling OpenCL)
{
EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF));
EXPECT_LT(cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF), 4e-6);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not EXPECT_FLOAT_EQ(0, cvtest::norm()) / EXPECT_NEAR() ? 4e-6 looks like a magic number to me.

// FIXME: use a comparison functor instead (after enabling OpenCL)
{
EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF));
EXPECT_LT(cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF), 4e-6);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

@asmorkalov asmorkalov force-pushed the as/gapi_phase_tolerance branch from 1736ee2 to edf0d83 Compare December 18, 2020 11:56
@asmorkalov asmorkalov force-pushed the as/gapi_phase_tolerance branch from edf0d83 to 009860e Compare December 18, 2020 11:58
@asmorkalov asmorkalov requested a review from alalek December 18, 2020 11:58
@opencv-pushbot opencv-pushbot merged commit 3e9158a into opencv:master Dec 18, 2020
@alalek alalek mentioned this pull request Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: g-api / gapi platform: arm ARM boards related issues: RPi, NVIDIA TK/TX, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subset of PhaseFluid/PhaseTest.AccuracyTest tests fails on arm64

5 participants