From b4e6cc59c713f9df0a6e877edd2128556c6e23c5 Mon Sep 17 00:00:00 2001 From: Xiang Zhang Date: Wed, 2 Dec 2020 11:23:54 -0800 Subject: [PATCH] skip the check for A channel (#5989) --- winml/test/image/imageTestHelper.cpp | 2 ++ winml/test/scenario/cppwinrt/scenariotestscppwinrt.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/winml/test/image/imageTestHelper.cpp b/winml/test/image/imageTestHelper.cpp index 1f769eeb46..6d0c536fbe 100644 --- a/winml/test/image/imageTestHelper.cpp +++ b/winml/test/image/imageTestHelper.cpp @@ -274,6 +274,8 @@ namespace ImageTestHelper { // So we use error rate. UINT errors = 0; for (uint32_t i = 0; i < size; i++, pActualByte++, pExpectedByte++) { + // Only the check the first three channels, which are (B, G, R) + if((i + 1) % 4 == 0) continue; auto diff = (*pActualByte - *pExpectedByte); if (diff > epsilon) { errors++; diff --git a/winml/test/scenario/cppwinrt/scenariotestscppwinrt.cpp b/winml/test/scenario/cppwinrt/scenariotestscppwinrt.cpp index 4a2c5b33d2..d4e6e832c4 100644 --- a/winml/test/scenario/cppwinrt/scenariotestscppwinrt.cpp +++ b/winml/test/scenario/cppwinrt/scenariotestscppwinrt.cpp @@ -768,9 +768,10 @@ bool VerifyHelper(ImageFeatureValue actual, ImageFeatureValue expected) { // hard code, might need to be modified later. const float cMaxErrorRate = 0.06f; byte epsilon = 20; - UINT errors = 0; for (uint32_t i = 0; i < size; i++, pActualByte++, pExpectedByte++) { + // Only the check the first three channels, which are (B, G, R) + if((i + 1) % 4 == 0) continue; auto diff = std::abs(*pActualByte - *pExpectedByte); if (diff > epsilon) { errors++;