Commit 51b329d64e18ee36f3bfd43ad3039b50ce42b36d
1 parent
4bf65682
Fixed up some old debugs, added some comments
Showing
7 changed files
with
9 additions
and
15 deletions
openbr/core/core.cpp
openbr/openbr_plugin.cpp
| ... | ... | @@ -390,12 +390,12 @@ TemplateList TemplateList::fromGallery(const br::File &gallery) |
| 390 | 390 | if (gallery.getBool("leaveOneOut")) { |
| 391 | 391 | QStringList subjects; |
| 392 | 392 | for (int i = 0; i < newTemplates.size(); i++) { |
| 393 | - QString subject = newTemplates.at(i).file.get<QString>("Subject"); | |
| 393 | + QString subject = newTemplates.at(i).file.get<QString>("Label"); | |
| 394 | 394 | // Have we seen this subject before? |
| 395 | 395 | if (subjects.contains(subject)) { |
| 396 | 396 | subjects.append(subject); |
| 397 | 397 | // Get indices belonging to this subject |
| 398 | - QList<int> subjectIndices = newTemplates.find("Subject",subject); | |
| 398 | + QList<int> subjectIndices = newTemplates.find("Label",subject); | |
| 399 | 399 | for (int j = 0; j < subjectIndices.size(); j++) { |
| 400 | 400 | // Set subject partitions |
| 401 | 401 | newTemplates[subjectIndices[j]].file.set("Partition",j); | ... | ... |
openbr/plugins/cascade.cpp
| ... | ... | @@ -84,7 +84,6 @@ class CascadeTransform : public UntrainableMetaTransform |
| 84 | 84 | foreach (const Template &t, src) { |
| 85 | 85 | const bool enrollAll = t.file.getBool("enrollAll"); |
| 86 | 86 | |
| 87 | - qDebug() << enrollAll; | |
| 88 | 87 | for (int i=0; i<t.size(); i++) { |
| 89 | 88 | const Mat &m = t[i]; |
| 90 | 89 | vector<Rect> rects; | ... | ... |
openbr/plugins/eyes.cpp
| ... | ... | @@ -182,8 +182,8 @@ private: |
| 182 | 182 | float second_eye_y = (right_rect.y + maxLoc.y)*gray.rows/height+roi.y; |
| 183 | 183 | |
| 184 | 184 | dst.m() = src.m(); |
| 185 | - //dst.file.appendPoint(QPointF(first_eye_x, first_eye_y)); | |
| 186 | - //dst.file.appendPoint(QPointF(second_eye_x, second_eye_y)); | |
| 185 | + dst.file.appendPoint(QPointF(first_eye_x, first_eye_y)); | |
| 186 | + dst.file.appendPoint(QPointF(second_eye_x, second_eye_y)); | |
| 187 | 187 | dst.file.set("First_Eye", QPointF(first_eye_x, first_eye_y)); |
| 188 | 188 | dst.file.set("Second_Eye", QPointF(second_eye_x, second_eye_y)); |
| 189 | 189 | } | ... | ... |
openbr/plugins/landmarks.cpp
| ... | ... | @@ -313,7 +313,8 @@ class LoadLandmarksTransform : public UntrainableTransform |
| 313 | 313 | { |
| 314 | 314 | dst = src; |
| 315 | 315 | |
| 316 | - QString path = Globals->path + "/" + src.file.baseName() + ".dat"; | |
| 316 | + // Assume the fiduciary file has the same basename as src | |
| 317 | + QString path = filePath + "/" + src.file.baseName() + ".dat"; | |
| 317 | 318 | |
| 318 | 319 | QFile f(path); |
| 319 | 320 | if (!f.open(QIODevice::ReadOnly)) qFatal("Unable to open %s for reading.", qPrintable(path)); |
| ... | ... | @@ -329,6 +330,8 @@ class LoadLandmarksTransform : public UntrainableTransform |
| 329 | 330 | } |
| 330 | 331 | } |
| 331 | 332 | |
| 333 | + if (landmarks.size() < 35) qFatal("Unrecognized landmark set format."); | |
| 334 | + | |
| 332 | 335 | dst.file.set("rightEye", landmarks[16]); |
| 333 | 336 | dst.file.set("leftEye", landmarks[18]); |
| 334 | 337 | ... | ... |
openbr/plugins/output.cpp
| ... | ... | @@ -365,12 +365,9 @@ class evalOutput : public MatrixOutput |
| 365 | 365 | |
| 366 | 366 | ~evalOutput() |
| 367 | 367 | { |
| 368 | - qDebug() << "here"; | |
| 369 | - | |
| 370 | 368 | if (data.data) { |
| 371 | 369 | const QString csv = QString(file.name).replace(".eval", ".csv"); |
| 372 | 370 | if ((Globals->crossValidate == 0) || (!crossValidate)) { |
| 373 | - qDebug() << "here"; | |
| 374 | 371 | Evaluate(data, BEE::makeMask(targetFiles, queryFiles), csv); |
| 375 | 372 | } else { |
| 376 | 373 | QFutureSynchronizer<float> futures; | ... | ... |
openbr/plugins/validate.cpp
| ... | ... | @@ -52,11 +52,7 @@ class CrossValidateTransform : public MetaTransform |
| 52 | 52 | // even if the partitions are different |
| 53 | 53 | if (leaveOneOut) { |
| 54 | 54 | QList<int> subjectIndices = partitionedData.find("Subject",partitionedData.at(j).file.get<QString>("Subject")); |
| 55 | - qDebug() << i << subjectIndices.size(); | |
| 56 | - if (i > subjectIndices.size()) { | |
| 57 | - qDebug() << i%subjectIndices.size(); | |
| 58 | - removed.append(subjectIndices[i%subjectIndices.size()]); | |
| 59 | - } | |
| 55 | + if (i > subjectIndices.size()) removed.append(subjectIndices[i%subjectIndices.size()]); | |
| 60 | 56 | } else if (partitions[j] == i) |
| 61 | 57 | removed.append(j); |
| 62 | 58 | typedef QPair<int,int> Pair; | ... | ... |