Commit fa4557b7995059f4128f191d6d349c1da20a2bae

Authored by Scott Klum
1 parent e7c3e62c

Removed personal debug statements, added filename filtering to empty gallery

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