Commit c2b1835e05d3b229db72d8829fb9ebf7e3cf31d8
Merge branch 'master' of https://github.com/biometrics/openbr
Showing
5 changed files
with
25 additions
and
0 deletions
app/br/br.cpp
| @@ -137,6 +137,9 @@ public: | @@ -137,6 +137,9 @@ public: | ||
| 137 | } else if (!strcmp(fun, "evalDetection")) { | 137 | } else if (!strcmp(fun, "evalDetection")) { |
| 138 | check((parc >= 2) && (parc <= 3), "Incorrect parameter count for 'evalDetection'."); | 138 | check((parc >= 2) && (parc <= 3), "Incorrect parameter count for 'evalDetection'."); |
| 139 | br_eval_detection(parv[0], parv[1], parc == 3 ? parv[2] : ""); | 139 | br_eval_detection(parv[0], parv[1], parc == 3 ? parv[2] : ""); |
| 140 | + } else if (!strcmp(fun, "evalLandmarking")) { | ||
| 141 | + check((parc >= 2) && (parc <= 3), "Incorrect parameter count for 'evalLandmarking'."); | ||
| 142 | + br_eval_detection(parv[0], parv[1], parc == 3 ? parv[2] : ""); | ||
| 140 | } else if (!strcmp(fun, "evalRegression")) { | 143 | } else if (!strcmp(fun, "evalRegression")) { |
| 141 | check(parc >= 2 && parc <= 4, "Incorrect parameter count for 'evalRegression'."); | 144 | check(parc >= 2 && parc <= 4, "Incorrect parameter count for 'evalRegression'."); |
| 142 | br_eval_regression(parv[0], parv[1], parc >= 3 ? parv[2] : "", parc >= 4 ? parv[3] : ""); | 145 | br_eval_regression(parv[0], parv[1], parc >= 3 ? parv[2] : "", parc >= 4 ? parv[3] : ""); |
| @@ -218,6 +221,7 @@ private: | @@ -218,6 +221,7 @@ private: | ||
| 218 | "-evalClassification <predicted_gallery> <truth_gallery> <predicted property name> <ground truth proprty name>\n" | 221 | "-evalClassification <predicted_gallery> <truth_gallery> <predicted property name> <ground truth proprty name>\n" |
| 219 | "-evalClustering <clusters> <gallery>\n" | 222 | "-evalClustering <clusters> <gallery>\n" |
| 220 | "-evalDetection <predicted_gallery> <truth_gallery> [{csv}]\n" | 223 | "-evalDetection <predicted_gallery> <truth_gallery> [{csv}]\n" |
| 224 | + "-evalLandmarking <predicted_gallery> <truth_gallery> [{csv}]\n" | ||
| 221 | "-evalRegression <predicted_gallery> <truth_gallery> <predicted property name> <ground truth property name>\n" | 225 | "-evalRegression <predicted_gallery> <truth_gallery> <predicted property name> <ground truth property name>\n" |
| 222 | "-plotDetection <file> ... <file> {destination}\n" | 226 | "-plotDetection <file> ... <file> {destination}\n" |
| 223 | "-plotMetadata <file> ... <file> <columns>\n" | 227 | "-plotMetadata <file> ... <file> <columns>\n" |
openbr/core/eval.cpp
| @@ -476,6 +476,13 @@ float EvalDetection(const QString &predictedInput, const QString &truthInput, co | @@ -476,6 +476,13 @@ float EvalDetection(const QString &predictedInput, const QString &truthInput, co | ||
| 476 | return averageOverlap; | 476 | return averageOverlap; |
| 477 | } | 477 | } |
| 478 | 478 | ||
| 479 | +void EvalLandmarking(const QString &predictedInput, const QString &truthInput, const QString &csv) | ||
| 480 | +{ | ||
| 481 | + (void) predictedInput; | ||
| 482 | + (void) truthInput; | ||
| 483 | + (void) csv; | ||
| 484 | +} | ||
| 485 | + | ||
| 479 | void EvalRegression(const QString &predictedInput, const QString &truthInput, QString predictedProperty, QString truthProperty) | 486 | void EvalRegression(const QString &predictedInput, const QString &truthInput, QString predictedProperty, QString truthProperty) |
| 480 | { | 487 | { |
| 481 | qDebug("Evaluating regression of %s against %s", qPrintable(predictedInput), qPrintable(truthInput)); | 488 | qDebug("Evaluating regression of %s against %s", qPrintable(predictedInput), qPrintable(truthInput)); |
openbr/core/eval.h
| @@ -28,6 +28,7 @@ namespace br | @@ -28,6 +28,7 @@ namespace br | ||
| 28 | float Evaluate(const cv::Mat &scores, const cv::Mat &masks, const QString &csv = ""); | 28 | float Evaluate(const cv::Mat &scores, const cv::Mat &masks, const QString &csv = ""); |
| 29 | void EvalClassification(const QString &predictedInput, const QString &truthInput, QString predictedProperty="", QString truthProperty=""); | 29 | void EvalClassification(const QString &predictedInput, const QString &truthInput, QString predictedProperty="", QString truthProperty=""); |
| 30 | float EvalDetection(const QString &predictedInput, const QString &truthInput, const QString &csv = ""); // Return average overlap | 30 | float EvalDetection(const QString &predictedInput, const QString &truthInput, const QString &csv = ""); // Return average overlap |
| 31 | + void EvalLandmarking(const QString &predictedInput, const QString &truthInput, const QString &csv = ""); | ||
| 31 | void EvalRegression(const QString &predictedInput, const QString &truthInput, QString predictedProperty="", QString truthProperty=""); | 32 | void EvalRegression(const QString &predictedInput, const QString &truthInput, QString predictedProperty="", QString truthProperty=""); |
| 32 | } | 33 | } |
| 33 | 34 |
openbr/openbr.cpp
| @@ -87,6 +87,11 @@ float br_eval_detection(const char *predicted_gallery, const char *truth_gallery | @@ -87,6 +87,11 @@ float br_eval_detection(const char *predicted_gallery, const char *truth_gallery | ||
| 87 | return EvalDetection(predicted_gallery, truth_gallery, csv); | 87 | return EvalDetection(predicted_gallery, truth_gallery, csv); |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | +void br_eval_landmarking(const char *predicted_gallery, const char *truth_gallery, const char *csv) | ||
| 91 | +{ | ||
| 92 | + return EvalLandmarking(predicted_gallery, truth_gallery, csv); | ||
| 93 | +} | ||
| 94 | + | ||
| 90 | void br_eval_regression(const char *predicted_gallery, const char *truth_gallery, const char * predicted_property, const char * truth_property) | 95 | void br_eval_regression(const char *predicted_gallery, const char *truth_gallery, const char * predicted_property, const char * truth_property) |
| 91 | { | 96 | { |
| 92 | EvalRegression(predicted_gallery, truth_gallery, predicted_property, truth_property); | 97 | EvalRegression(predicted_gallery, truth_gallery, predicted_property, truth_property); |
openbr/openbr.h
| @@ -169,6 +169,14 @@ BR_EXPORT void br_eval_clustering(const char *csv, const char *gallery); | @@ -169,6 +169,14 @@ BR_EXPORT void br_eval_clustering(const char *csv, const char *gallery); | ||
| 169 | BR_EXPORT float br_eval_detection(const char *predicted_gallery, const char *truth_gallery, const char *csv = ""); | 169 | BR_EXPORT float br_eval_detection(const char *predicted_gallery, const char *truth_gallery, const char *csv = ""); |
| 170 | 170 | ||
| 171 | /*! | 171 | /*! |
| 172 | + * \brief Evaluates and prints landmarking accuracy to terminal. | ||
| 173 | + * \param predicted_gallery The predicted br::Gallery. | ||
| 174 | + * \param truth_gallery The ground truth br::Gallery. | ||
| 175 | + * \param csv Optional \c .csv file to contain performance metrics. | ||
| 176 | + */ | ||
| 177 | +BR_EXPORT void br_eval_landmarking(const char *predicted_gallery, const char *truth_gallery, const char *csv = ""); | ||
| 178 | + | ||
| 179 | +/*! | ||
| 172 | * \brief Evaluates regression accuracy to disk. | 180 | * \brief Evaluates regression accuracy to disk. |
| 173 | * \param predicted_gallery The predicted br::Gallery. | 181 | * \param predicted_gallery The predicted br::Gallery. |
| 174 | * \param truth_gallery The ground truth br::Gallery. | 182 | * \param truth_gallery The ground truth br::Gallery. |