Commit 52d6aaf060f42d8ad004bec6f4e56f9c3d9749e2

Authored by Josh Klontz
1 parent e7d4da1c

in EvalLandmarking also ignore instances where the ground truth appears to be fo…

…r another object in the image
Showing 1 changed file with 10 additions and 3 deletions
openbr/core/eval.cpp
@@ -878,7 +878,14 @@ float EvalLandmarking(const QString &predictedGallery, const QString &truthGalle @@ -878,7 +878,14 @@ float EvalLandmarking(const QString &predictedGallery, const QString &truthGalle
878 const float normalizedLength = QtUtils::euclideanLength(truthPoints[normalizationIndexB] - truthPoints[normalizationIndexA]); 878 const float normalizedLength = QtUtils::euclideanLength(truthPoints[normalizationIndexB] - truthPoints[normalizationIndexA]);
879 const float normalizedOrientation = QtUtils::orientation(truthPoints[normalizationIndexB], truthPoints[normalizationIndexA]); 879 const float normalizedOrientation = QtUtils::orientation(truthPoints[normalizationIndexB], truthPoints[normalizationIndexA]);
880 880
881 - if (predictedPoints.size() != truthPoints.size() || qIsNaN(normalizedLength)) { 881 + if (// If the landmarks don't match up
  882 + (predictedPoints.size() != truthPoints.size())
  883 + // Or the landmarks used for normalization are missing
  884 + || qIsNaN(normalizedLength)
  885 + // Or the ground truth seems to be for another object in the image
  886 + || (QtUtils::euclideanLength(predictedPoints[normalizationIndexA] - truthPoints[normalizationIndexA]) / normalizedLength >= 0.5)
  887 + || (QtUtils::euclideanLength(predictedPoints[normalizationIndexB] - truthPoints[normalizationIndexB]) / normalizedLength >= 0.5)
  888 + ) {
882 predicted.removeAt(i); 889 predicted.removeAt(i);
883 predictedNames.removeAt(i); 890 predictedNames.removeAt(i);
884 truth.removeAt(i); 891 truth.removeAt(i);
@@ -908,7 +915,7 @@ float EvalLandmarking(const QString &predictedGallery, const QString &truthGalle @@ -908,7 +915,7 @@ float EvalLandmarking(const QString &predictedGallery, const QString &truthGalle
908 imageErrors.append(totalError/totalCount); 915 imageErrors.append(totalError/totalCount);
909 } 916 }
910 917
911 - qDebug() << "Skipped" << skipped << "files due to point size mismatch or NaN normalized length."; 918 + qDebug("Files skipped: %d", skipped);
912 919
913 // Adjust the point error to not penalize for systematic biases... 920 // Adjust the point error to not penalize for systematic biases...
914 // ... by first calculating the average bias for each point 921 // ... by first calculating the average bias for each point
@@ -1008,7 +1015,7 @@ float EvalLandmarking(const QString &amp;predictedGallery, const QString &amp;truthGalle @@ -1008,7 +1015,7 @@ float EvalLandmarking(const QString &amp;predictedGallery, const QString &amp;truthGalle
1008 1015
1009 QtUtils::writeFile(csv, lines); 1016 QtUtils::writeFile(csv, lines);
1010 1017
1011 - qDebug("Average Error for all Points: %.3f", averagePointError); 1018 + qDebug("Mean Average Error: %.4f", averagePointError);
1012 1019
1013 return averagePointError; 1020 return averagePointError;
1014 } 1021 }