From 872ecd47d4c632a584ac0402f8ba06edf4ba831f Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Tue, 26 Nov 2013 10:57:59 -0500 Subject: [PATCH] commented eval detection for #138 --- openbr/core/eval.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/openbr/core/eval.cpp b/openbr/core/eval.cpp index 15246cc..d83f8f5 100644 --- a/openbr/core/eval.cpp +++ b/openbr/core/eval.cpp @@ -394,6 +394,7 @@ static QStringList computeDetectionResults(const QList &detec for (int i=0; i= 0.5) TP++; else FP++; } else { @@ -507,11 +508,13 @@ float EvalDetection(const QString &predictedGallery, const QString &truthGallery QMap allDetections = getDetections(predicted, truth); QList resolvedDetections, falseNegativeDetections; - foreach (Detections detections, allDetections.values()) { + foreach (Detections detections, allDetections.values()) { // For every file + // Try to associate ground truth detections with predicted detections while (!detections.truth.isEmpty() && !detections.predicted.isEmpty()) { - const Detection truth = detections.truth.takeFirst(); + const Detection truth = detections.truth.takeFirst(); // Take removes the detection int bestIndex = -1; float bestOverlap = -std::numeric_limits::max(); + // Find the nearest predicted detection to this ground truth detection for (int i=0; i bestOverlap) { @@ -519,6 +522,9 @@ float EvalDetection(const QString &predictedGallery, const QString &truthGallery bestIndex = i; } } + // Removing the detection prevents us from considering it twice. + // We don't want to associate two ground truth detections with the + // same prediction, over vice versa. const Detection predicted = detections.predicted.takeAt(bestIndex); resolvedDetections.append(ResolvedDetection(predicted.confidence, bestOverlap)); } -- libgit2 0.21.4