Commit ff55f43c21ea89c1cba0c2300afd140d383a0d24

Authored by Jordan Cheney
1 parent 50975d83

slight refactoring for beautification

app/br/br.cpp
@@ -247,7 +247,7 @@ private: @@ -247,7 +247,7 @@ private:
247 "-convert (Format|Gallery|Output) <input_file> {output_file}\n" 247 "-convert (Format|Gallery|Output) <input_file> {output_file}\n"
248 "-evalClassification <predicted_gallery> <truth_gallery> <predicted property name> <ground truth proprty name>\n" 248 "-evalClassification <predicted_gallery> <truth_gallery> <predicted property name> <ground truth proprty name>\n"
249 "-evalClustering <clusters> <gallery>\n" 249 "-evalClustering <clusters> <gallery>\n"
250 - "-evalDetection <predicted_gallery> <truth_gallery> [{csv}]\n" 250 + "-evalDetection <predicted_gallery> <truth_gallery> [{csv}] [{minSize}]\n"
251 "-evalLandmarking <predicted_gallery> <truth_gallery> [{csv} [<normalization_index_a> <normalization_index_b>]]\n" 251 "-evalLandmarking <predicted_gallery> <truth_gallery> [{csv} [<normalization_index_a> <normalization_index_b>]]\n"
252 "-evalRegression <predicted_gallery> <truth_gallery> <predicted property name> <ground truth property name>\n" 252 "-evalRegression <predicted_gallery> <truth_gallery> <predicted property name> <ground truth property name>\n"
253 "-plotDetection <file> ... <file> {destination}\n" 253 "-plotDetection <file> ... <file> {destination}\n"
openbr/core/eval.cpp
@@ -820,21 +820,23 @@ float EvalDetection(const QString &amp;predictedGallery, const QString &amp;truthGallery @@ -820,21 +820,23 @@ float EvalDetection(const QString &amp;predictedGallery, const QString &amp;truthGallery
820 qDebug("Evaluating detection of %s against %s", qPrintable(predictedGallery), qPrintable(truthGallery)); 820 qDebug("Evaluating detection of %s against %s", qPrintable(predictedGallery), qPrintable(truthGallery));
821 // Organized by file, QMap used to preserve order 821 // Organized by file, QMap used to preserve order
822 QMap<QString, Detections> allDetections = getDetections(predictedGallery, truthGallery); 822 QMap<QString, Detections> allDetections = getDetections(predictedGallery, truthGallery);
823 - 823 +
824 // Remove any bounding boxes with a side smaller than minSize 824 // Remove any bounding boxes with a side smaller than minSize
825 if (minSize > 0) { 825 if (minSize > 0) {
  826 + qDebug("Removing boxes smaller than %d\n", minSize);
826 foreach(QString key, allDetections.keys()) { 827 foreach(QString key, allDetections.keys()) {
827 - for (int i = 0; i < allDetections[key].predicted.length(); i++) {  
828 - QRectF box = allDetections[key].predicted[i].boundingBox; 828 + Detections detections = allDetections[key];
  829 + for (int i = 0; i < detections.predicted.length(); i++) {
  830 + QRectF box = detections.predicted[i].boundingBox;
829 if (min(box.width(), box.height()) < minSize) 831 if (min(box.width(), box.height()) < minSize)
830 - allDetections[key].predicted.removeAt(i); 832 + detections.predicted.removeAt(i);
831 } 833 }
832 - for (int i = 0; i < allDetections[key].truth.length(); i++) {  
833 - QRectF box = allDetections[key].truth[i].boundingBox; 834 + for (int i = 0; i < detections.truth.length(); i++) {
  835 + QRectF box = detections.truth[i].boundingBox;
834 if (min(box.width(), box.height()) < minSize) 836 if (min(box.width(), box.height()) < minSize)
835 - allDetections[key].truth.removeAt(i); 837 + detections.truth.removeAt(i);
836 } 838 }
837 - } 839 + }
838 } 840 }
839 841
840 QList<ResolvedDetection> resolvedDetections, falseNegativeDetections; 842 QList<ResolvedDetection> resolvedDetections, falseNegativeDetections;
openbr/openbr.h
@@ -196,7 +196,7 @@ BR_EXPORT void br_eval_clustering(const char *csv, const char *gallery, const ch @@ -196,7 +196,7 @@ BR_EXPORT void br_eval_clustering(const char *csv, const char *gallery, const ch
196 * \param normalize Optional \c bool flag to normalize predicted bounding boxes for improved detection. 196 * \param normalize Optional \c bool flag to normalize predicted bounding boxes for improved detection.
197 * \return Average detection bounding box overlap. 197 * \return Average detection bounding box overlap.
198 */ 198 */
199 -BR_EXPORT float br_eval_detection(const char *predicted_gallery, const char *truth_gallery, const char *csv = "", bool normalize = false, int minSize); 199 +BR_EXPORT float br_eval_detection(const char *predicted_gallery, const char *truth_gallery, const char *csv = "", bool normalize = false, int minSize = 0);
200 200
201 /*! 201 /*!
202 * \brief Evaluates and prints landmarking accuracy to terminal. 202 * \brief Evaluates and prints landmarking accuracy to terminal.