Commit 3de65631c5743cdf87fadfcb109a9907e5936184

Authored by Josh Klontz
1 parent b3488cbf

treat 0,0 like -1,-1 and NaN,NaN

Showing 1 changed file with 3 additions and 2 deletions
openbr/core/eval.cpp
@@ -866,10 +866,11 @@ float EvalLandmarking(const QString &predictedGallery, const QString &truthGalle @@ -866,10 +866,11 @@ float EvalLandmarking(const QString &predictedGallery, const QString &truthGalle
866 QList<QPointF> truthPoints = truth[truthIndex].file.points(); 866 QList<QPointF> truthPoints = truth[truthIndex].file.points();
867 867
868 // Standardize how we represent unlabeled points here 868 // Standardize how we represent unlabeled points here
869 - const QPointF find(-1,-1); 869 + const QPointF findNegOne(-1,-1);
  870 + const QPointF findZero(0,0);
870 const QPointF replace(std::numeric_limits<float>::quiet_NaN(), std::numeric_limits<float>::quiet_NaN()); 871 const QPointF replace(std::numeric_limits<float>::quiet_NaN(), std::numeric_limits<float>::quiet_NaN());
871 for (int j=0; j<truthPoints.size(); j++) 872 for (int j=0; j<truthPoints.size(); j++)
872 - if (truthPoints[j] == find) 873 + if ((truthPoints[j] == findNegOne) || (truthPoints[j] == findZero))
873 truthPoints[j] = replace; 874 truthPoints[j] = replace;
874 875
875 if (normalizationIndexA >= truthPoints.size()) qFatal("Normalization index A is out of range."); 876 if (normalizationIndexA >= truthPoints.size()) qFatal("Normalization index A is out of range.");