Commit fa4557b7995059f4128f191d6d349c1da20a2bae
1 parent
e7c3e62c
Removed personal debug statements, added filename filtering to empty gallery
Showing
6 changed files
with
7 additions
and
14 deletions
openbr/core/bee.cpp
| ... | ... | @@ -102,7 +102,7 @@ void BEE::writeSigset(const QString &sigset, const br::FileList &files, bool ign |
| 102 | 102 | if ((key == "Index") || (key == "Subject")) continue; |
| 103 | 103 | metadata.append(key+"=\""+QtUtils::toString(file.value(key))+"\""); |
| 104 | 104 | } |
| 105 | - lines.append("\t<biometric-signature name=\"" + file.name +"\">"); | |
| 105 | + lines.append("\t<biometric-signature name=\"" + file.get<QString>("Subject",file.fileName()) +"\">"); | |
| 106 | 106 | lines.append("\t\t<presentation file-name=\"" + file.name + "\" " + metadata.join(" ") + "/>"); |
| 107 | 107 | lines.append("\t</biometric-signature>"); |
| 108 | 108 | } |
| ... | ... | @@ -273,11 +273,6 @@ cv::Mat BEE::makeMask(const br::FileList &targets, const br::FileList &queries, |
| 273 | 273 | QList<int> targetPartitions = targets.crossValidationPartitions(); |
| 274 | 274 | QList<int> queryPartitions = queries.crossValidationPartitions(); |
| 275 | 275 | |
| 276 | - qDebug() << "Targets: " << targetLabels << "\n"; | |
| 277 | - qDebug() << "Targets: " << targetPartitions << "\n"; | |
| 278 | - qDebug() << "Queries: " << queryLabels << "\n"; | |
| 279 | - qDebug() << "Queries: " << queryPartitions << "\n"; | |
| 280 | - | |
| 281 | 276 | Mat mask(queries.size(), targets.size(), CV_8UC1); |
| 282 | 277 | for (int i=0; i<queries.size(); i++) { |
| 283 | 278 | const QString &fileA = queries[i]; |
| ... | ... | @@ -303,8 +298,6 @@ cv::Mat BEE::makeMask(const br::FileList &targets, const br::FileList &queries, |
| 303 | 298 | } |
| 304 | 299 | } |
| 305 | 300 | |
| 306 | - qDebug() << mask.row(0); | |
| 307 | - | |
| 308 | 301 | return mask; |
| 309 | 302 | } |
| 310 | 303 | ... | ... |
openbr/core/eval.cpp
| ... | ... | @@ -119,9 +119,6 @@ float Evaluate(const Mat &simmat, const Mat &mask, const QString &csv) |
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - qDebug() << genuineCount; | |
| 123 | - qDebug() << impostorCount; | |
| 124 | - | |
| 125 | 122 | if (numNaNs > 0) qWarning("Encountered %d NaN scores!", numNaNs); |
| 126 | 123 | if (genuineCount == 0) qFatal("No genuine scores!"); |
| 127 | 124 | if (impostorCount == 0) qFatal("No impostor scores!"); | ... | ... |
openbr/plugins/gallery.cpp
| ... | ... | @@ -168,7 +168,7 @@ class EmptyGallery : public Gallery |
| 168 | 168 | QRegExp re(regexp); |
| 169 | 169 | re.setPatternSyntax(QRegExp::Wildcard); |
| 170 | 170 | for (int i=templates.size()-1; i>=0; i--) { |
| 171 | - if (!re.exactMatch(templates[i].file.suffix())) { | |
| 171 | + if (!re.exactMatch(templates[i].file.fileName())) { | |
| 172 | 172 | templates.removeAt(i); |
| 173 | 173 | } |
| 174 | 174 | } | ... | ... |
openbr/plugins/gui.cpp
| ... | ... | @@ -215,7 +215,7 @@ public: |
| 215 | 215 | |
| 216 | 216 | foreach (const QString & s, keys) { |
| 217 | 217 | if (s.compare("name", Qt::CaseInsensitive) == 0) { |
| 218 | - newTitle = newTitle + s + ": " + t.file.name + " "; | |
| 218 | + newTitle = newTitle + s + ": " + t.file.fileName() + " "; | |
| 219 | 219 | } else if (t.file.contains(s)) { |
| 220 | 220 | QString out = t.file.get<QString>(s); |
| 221 | 221 | newTitle = newTitle + s + ": " + out + " "; | ... | ... |
openbr/plugins/output.cpp
| ... | ... | @@ -442,8 +442,10 @@ class rankOutput : public MatrixOutput |
| 442 | 442 | |
| 443 | 443 | typedef QPair<int,int> RankPair; |
| 444 | 444 | foreach (const RankPair &pair, Common::Sort(ranks, false)) |
| 445 | + // pair.first == rank retrieved, pair.second == original position | |
| 445 | 446 | lines.append(queryFiles[pair.second].name + " " + QString::number(pair.first) + " " + QString::number(scores[pair.second]) + " " + targetFiles[positions[pair.second]].name); |
| 446 | 447 | |
| 448 | + | |
| 447 | 449 | QtUtils::writeFile(file, lines); |
| 448 | 450 | } |
| 449 | 451 | }; | ... | ... |
openbr/plugins/validate.cpp
| ... | ... | @@ -116,7 +116,8 @@ class FilterDistance : public Distance |
| 116 | 116 | foreach (const QString &key, Globals->filters.keys()) { |
| 117 | 117 | bool keep = false; |
| 118 | 118 | const QString metadata = a.file.get<QString>(key, ""); |
| 119 | - if (metadata.isEmpty() || Globals->filters[key].isEmpty()) continue; | |
| 119 | + if (Globals->filters[key].isEmpty()) continue; | |
| 120 | + if (metadata.isEmpty()) return -std::numeric_limits<float>::max(); | |
| 120 | 121 | foreach (const QString &value, Globals->filters[key]) { |
| 121 | 122 | if (metadata == value) { |
| 122 | 123 | keep = true; | ... | ... |