diff --git a/openbr/core/eval.cpp b/openbr/core/eval.cpp index 0f7313b..4db31c7 100755 --- a/openbr/core/eval.cpp +++ b/openbr/core/eval.cpp @@ -100,10 +100,10 @@ static cv::Mat constructMatchingMask(const cv::Mat &scores, const FileList &targ float Evaluate(const cv::Mat &scores, const FileList &target, const FileList &query, const QString &csv, int partition) { - return Evaluate(scores, constructMatchingMask(scores, target, query, partition), QString(), QString(), csv, 0); + return Evaluate(scores, constructMatchingMask(scores, target, query, partition), csv, QString(), QString(), 0); } -float Evaluate(const QString &simmat, const QString &mask, const QString &csv, int matches) +float Evaluate(const QString &simmat, const QString &mask, const QString &csv, unsigned int matches) { qDebug("Evaluating %s%s%s", qPrintable(simmat), @@ -137,12 +137,12 @@ float Evaluate(const QString &simmat, const QString &mask, const QString &csv, i truth = format->read(); } - return Evaluate(scores, truth, target, query, csv, matches); + return Evaluate(scores, truth, csv, target, query, matches); } -float Evaluate(const Mat &simmat, const Mat &mask, const QString &target, const QString &query, const QString &csv, int matches) +float Evaluate(const Mat &simmat, const Mat &mask, const QString &csv, const QString &target, const QString &query, unsigned int matches) { - if ((target.isEmpty() || query.isEmpty()) && matches != 0) matches = 0; + if (target.isEmpty() || query.isEmpty()) matches = 0; if (simmat.size() != mask.size()) qFatal("Similarity matrix (%ix%i) differs in size from mask matrix (%ix%i).", simmat.rows, simmat.cols, mask.rows, mask.cols); @@ -173,7 +173,7 @@ float Evaluate(const Mat &simmat, const Mat &mask, const QString &target, const if (comparison.genuine) { genuineCount++; if (matches != 0){ - if (botGenuines.size() < matches) { + if (botGenuines.size() < (int)matches) { botGenuines.append(comparison); std::sort(botGenuines.begin(), botGenuines.end()); } else if (comparison.score < botGenuines.first().score) { @@ -185,7 +185,7 @@ float Evaluate(const Mat &simmat, const Mat &mask, const QString &target, const } else { impostorCount++; if (matches != 0) { - if (topImpostors.size() < matches) { + if (topImpostors.size() < (int)matches) { topImpostors.append(comparison); std::sort(topImpostors.begin(), topImpostors.end()); } else if (topImpostors.last().score < comparison.score) { @@ -266,8 +266,8 @@ float Evaluate(const Mat &simmat, const Mat &mask, const QString &target, const QString filePath = Globals->path; if (matches != 0) { - FileList targetFiles = TemplateList::fromGallery(target).files(); - FileList queryFiles = TemplateList::fromGallery(query).files(); + const FileList targetFiles = TemplateList::fromGallery(target).files(); + const FileList queryFiles = TemplateList::fromGallery(query).files(); for (int i=0; i("Label")+":" +filePath+"/"+targetFiles[topImpostors[i].target].name+":"+queryFiles[topImpostors[i].query].get("Label")+":"+filePath+"/"+queryFiles[topImpostors[i].query].name); diff --git a/openbr/core/eval.h b/openbr/core/eval.h index 169690d..ff47c7f 100644 --- a/openbr/core/eval.h +++ b/openbr/core/eval.h @@ -23,9 +23,9 @@ namespace br { - float Evaluate(const QString &simmat, const QString &mask = "", const QString &csv = "", int matches = 0); // Returns TAR @ FAR = 0.001 + float Evaluate(const QString &simmat, const QString &mask = "", const QString &csv = "", unsigned int matches = 0); // Returns TAR @ FAR = 0.001 float Evaluate(const cv::Mat &scores, const FileList &target, const FileList &query, const QString &csv = "", int parition = 0); - float Evaluate(const cv::Mat &scores, const cv::Mat &masks, const QString &target = "", const QString &query = "", const QString &csv = "", int matches = 0); + float Evaluate(const cv::Mat &scores, const cv::Mat &masks, const QString &csv = "", const QString &target = "", const QString &query = "", unsigned int matches = 0); float InplaceEval(const QString & simmat, const QString & target, const QString & query, const QString & csv = ""); void EvalClassification(const QString &predictedGallery, const QString &truthGallery, QString predictedProperty = "", QString truthProperty = "");