Commit 9b2cfd5b75c60d64c85ffacfefdf7ceae3e730f3
1 parent
e67fca6c
Premerge commit
Showing
6 changed files
with
17 additions
and
13 deletions
openbr/core/bee.cpp
| ... | ... | @@ -265,6 +265,9 @@ cv::Mat BEE::makeMask(const br::FileList &targets, const br::FileList &queries, |
| 265 | 265 | QList<int> targetPartitions = targets.crossValidationPartitions(); |
| 266 | 266 | QList<int> queryPartitions = queries.crossValidationPartitions(); |
| 267 | 267 | |
| 268 | + for (int i = 0; i < 5; i++) qDebug() << "QueryPartition " << queries[i].fileName() << ": " << queryPartitions[i]; | |
| 269 | + for (int i = 0; i < 5; i++) qDebug() << "TargetPartition " << targets[i].fileName() << ": " << targetPartitions[i]; | |
| 270 | + | |
| 268 | 271 | Mat mask(queries.size(), targets.size(), CV_8UC1); |
| 269 | 272 | for (int i=0; i<queries.size(); i++) { |
| 270 | 273 | const QString &fileA = queries[i]; | ... | ... |
openbr/openbr_plugin.cpp
| ... | ... | @@ -401,6 +401,7 @@ TemplateList TemplateList::fromGallery(const br::File &gallery) |
| 401 | 401 | { |
| 402 | 402 | TemplateList templates; |
| 403 | 403 | foreach (const br::File &file, gallery.split()) { |
| 404 | + qDebug() << file.name; | |
| 404 | 405 | QScopedPointer<Gallery> i(Gallery::make(file)); |
| 405 | 406 | TemplateList newTemplates = i->read(); |
| 406 | 407 | |
| ... | ... | @@ -424,7 +425,6 @@ TemplateList TemplateList::fromGallery(const br::File &gallery) |
| 424 | 425 | const int crossValidate = gallery.get<int>("crossValidate"); |
| 425 | 426 | if (crossValidate > 0) srand(0); |
| 426 | 427 | |
| 427 | - // Propogate metadata | |
| 428 | 428 | for (int i=newTemplates.size()-1; i>=0; i--) { |
| 429 | 429 | newTemplates[i].file.append(gallery.localMetadata()); |
| 430 | 430 | newTemplates[i].file.append(file.localMetadata()); | ... | ... |
openbr/openbr_plugin.h
| ... | ... | @@ -299,7 +299,7 @@ struct BR_EXPORT FileList : public QList<File> |
| 299 | 299 | * \brief A list of matrices associated with a file. |
| 300 | 300 | * |
| 301 | 301 | * The br::Template is one of the workhorse classes in OpenBR. |
| 302 | - * A template represents a biometric at various stages of enrollment and can be modified br::Transform and compared to other templates with br::Distance. | |
| 302 | + * A template represents a biometric at various stages of enrollment and can be modified by br::Transform and compared to other templates with br::Distance. | |
| 303 | 303 | * |
| 304 | 304 | * While there exist many cases (ex. video enrollment, multiple face detects, per-patch subspace learning, ...) where the template will contain more than one matrix, |
| 305 | 305 | * in most cases templates have exactly one matrix in their list representing a single image at various stages of enrollment. | ... | ... |
openbr/plugins/distance.cpp
| ... | ... | @@ -197,7 +197,10 @@ class AverageDistance : public Distance |
| 197 | 197 | if (a.size() != b.size()) qFatal("Comparison size mismatch"); |
| 198 | 198 | |
| 199 | 199 | float score = 0; |
| 200 | - for (int i = 0; i < a.size(); i++) score += distance->compare(a[i],b[i]); | |
| 200 | + for (int i = 0; i < a.size(); i++) { | |
| 201 | + qDebug() << "Computing score for: " << a.file.name << " vs. " << b.file.name; | |
| 202 | + score += distance->compare(a[i],b[i]); | |
| 203 | + } | |
| 201 | 204 | |
| 202 | 205 | return score/(float)a.size(); |
| 203 | 206 | } | ... | ... |
openbr/plugins/misc.cpp
| ... | ... | @@ -307,7 +307,7 @@ BR_REGISTER(Transform, LabelTransform) |
| 307 | 307 | |
| 308 | 308 | /*! |
| 309 | 309 | * \ingroup transforms |
| 310 | - * \brief Name a point | |
| 310 | + * \brief Remove a name from a point | |
| 311 | 311 | * \author Scott Klum \cite sklum |
| 312 | 312 | */ |
| 313 | 313 | class AnonymizeTransform : public UntrainableMetaTransform | ... | ... |
openbr/plugins/stasm.cpp
| ... | ... | @@ -33,15 +33,13 @@ BR_REGISTER(Initializer, StasmInitializer) |
| 33 | 33 | * \brief Wraps STASM key point detector |
| 34 | 34 | * \author Scott Klum \cite sklum |
| 35 | 35 | */ |
| 36 | -// TODO: Use a global mutex to prevent concurrent calls to AsmSearchDll | |
| 37 | - | |
| 38 | 36 | class StasmTransform : public UntrainableTransform |
| 39 | 37 | { |
| 40 | 38 | Q_OBJECT |
| 41 | 39 | |
| 42 | 40 | void init() |
| 43 | 41 | { |
| 44 | - Globals->setProperty("parallelism", "0"); // Can only work in single threaded mode | |
| 42 | + // Load models | |
| 45 | 43 | } |
| 46 | 44 | |
| 47 | 45 | void project(const Template &src, Template &dst) const |
| ... | ... | @@ -49,22 +47,22 @@ class StasmTransform : public UntrainableTransform |
| 49 | 47 | static QMutex mutex; |
| 50 | 48 | QMutexLocker locker(&mutex); |
| 51 | 49 | |
| 52 | - int nlandmarks; | |
| 50 | + int numLandmarks; | |
| 53 | 51 | int landmarks[500]; |
| 54 | 52 | |
| 55 | - AsmSearchDll(&nlandmarks, landmarks, | |
| 56 | - qPrintable(src.file.name), reinterpret_cast<char*>(src.m().data), src.m().cols, src.m().rows, | |
| 57 | - src.m(), (src.m().channels() == 3), qPrintable(Globals->sdkPath + "/share/openbr/models/stasm/mu-68-1d.conf"), qPrintable(Globals->sdkPath + "/share/openbr/models/stasm/mu-76-2d.conf"), qPrintable(Globals->sdkPath + "/share/openbr/models/stasm/")); | |
| 53 | + AsmSearchDll(numLandmarks, landmarks, qPrintable(src.file.name), reinterpret_cast<char*>(src.m().data), src.m(), qPrintable(Globals->sdkPath + "/share/openbr/models/stasm/mu-68-1d.conf"), qPrintable(Globals->sdkPath + "/share/openbr/models/stasm/mu-76-2d.conf"), qPrintable(Globals->sdkPath + "/share/openbr/models/stasm/")); | |
| 58 | 54 | |
| 59 | - if (nlandmarks == 0) { | |
| 55 | + if (numLandmarks == 0) { | |
| 60 | 56 | qWarning("Unable to detect Stasm landmarks for %s", qPrintable(src.file.fileName())); |
| 61 | 57 | dst.file.set("FTE", true); |
| 62 | 58 | dst.m() = src.m(); |
| 63 | 59 | return; |
| 64 | 60 | } |
| 65 | 61 | |
| 66 | - for (int i = 0; i < nlandmarks; i++) | |
| 62 | + for (int i = 0; i < numLandmarks; i++) { | |
| 63 | + qDebug() << QPointF(landmarks[2 * i], landmarks[2 * i + 1]); | |
| 67 | 64 | dst.file.appendPoint(QPointF(landmarks[2 * i], landmarks[2 * i + 1])); |
| 65 | + } | |
| 68 | 66 | |
| 69 | 67 | dst.m() = src.m(); |
| 70 | 68 | } | ... | ... |