From 5c750607792b36b1bade51ff205fd2d4db69884d Mon Sep 17 00:00:00 2001 From: Scott Klum Date: Mon, 2 Dec 2013 17:16:14 -0500 Subject: [PATCH] Almost have copying done, need to work out enums --- openbr/core/core.cpp | 2 +- openbr/plugins/openbr_internal.h | 22 +++++++++++++++++++++- openbr/plugins/quality.cpp | 3 +++ openbr/plugins/stream.cpp | 9 ++++++++- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/openbr/core/core.cpp b/openbr/core/core.cpp index 6b52578..81686c3 100644 --- a/openbr/core/core.cpp +++ b/openbr/core/core.cpp @@ -45,7 +45,7 @@ struct AlgorithmCore qDebug("Training on %s%s", qPrintable(input.flat()), model.isEmpty() ? "" : qPrintable(" to " + model)); - QScopedPointer trainingWrapper(Transform::make("DirectStream([Identity])", NULL)); + QScopedPointer trainingWrapper(Transform::make("DirectStream([Identity], readMode=DistributeFrames)", NULL)); CompositeTransform * downcast = dynamic_cast(trainingWrapper.data()); if (downcast == NULL) qFatal("downcast failed?"); diff --git a/openbr/plugins/openbr_internal.h b/openbr/plugins/openbr_internal.h index 2680873..786272a 100644 --- a/openbr/plugins/openbr_internal.h +++ b/openbr/plugins/openbr_internal.h @@ -1,6 +1,8 @@ #ifndef OPENBR_INTERNAL_H #define OPENBR_INTERNAL_H +#include + #include "openbr/openbr_plugin.h" #include "openbr/core/resource.h" @@ -260,9 +262,27 @@ public: newTransform = true; QString name = metaObject()->className(); + name.replace("Transform",""); - name += "([])"; + name += "(["; + name += "],"; + + QStringList parameters; + + // Skip name and transforms (handled below) + for (int i = 2; i < metaObject()->propertyCount();i++) { + QMetaProperty property = metaObject()->property(i); + parameters.append(property.read(this).toString()); + } + + name += parameters.join(","); + + name += ")"; + name.replace("br::",""); + + qDebug() << name; + CompositeTransform * output = dynamic_cast(Transform::make(name, NULL)); if (output == NULL) diff --git a/openbr/plugins/quality.cpp b/openbr/plugins/quality.cpp index 7df4b54..78dd0d2 100644 --- a/openbr/plugins/quality.cpp +++ b/openbr/plugins/quality.cpp @@ -179,6 +179,9 @@ class MatchProbabilityDistance : public Distance } } + qDebug() << "Genuines:" << genuineScores; + qDebug() << "Impostors:" << impostorScores; + mp = MP(genuineScores, impostorScores); } diff --git a/openbr/plugins/stream.cpp b/openbr/plugins/stream.cpp index 440ab1c..ccf39e0 100644 --- a/openbr/plugins/stream.cpp +++ b/openbr/plugins/stream.cpp @@ -253,6 +253,8 @@ public: bool getNextTemplate(Template & output) { + qDebug() << "Next as video"; + if (!isOpen()) { qDebug("video source is not open"); return false; @@ -1058,7 +1060,9 @@ public: if (src.empty()) return; - bool res = readStage->dataSource.open(src,readMode); + qDebug() << "Reading with mode:" << readMode; + + bool res = readStage->dataSource.open(src,br::Idiocy::DistributeFrames); if (!res) { qDebug("stream failed to open %s", qPrintable(dst[0].file.name)); return; @@ -1206,6 +1210,8 @@ public: // And the collection stage points to the read stage, because this is // a ring buffer. collectionStage->nextStage = readStage; + + qDebug() << "Init Readmode:" << readMode; } DirectStreamTransform() @@ -1323,6 +1329,7 @@ public: basis.activeFrames = this->activeFrames; basis.readMode = this->readMode; + qDebug() << basis.readMode; // We need at least a CompositeTransform * to acess transform's children. CompositeTransform * downcast = dynamic_cast (transform); -- libgit2 0.21.4