Commit 5c750607792b36b1bade51ff205fd2d4db69884d

Authored by Scott Klum
1 parent 83b596bd

Almost have copying done, need to work out enums

openbr/core/core.cpp
@@ -45,7 +45,7 @@ struct AlgorithmCore @@ -45,7 +45,7 @@ struct AlgorithmCore
45 qDebug("Training on %s%s", qPrintable(input.flat()), 45 qDebug("Training on %s%s", qPrintable(input.flat()),
46 model.isEmpty() ? "" : qPrintable(" to " + model)); 46 model.isEmpty() ? "" : qPrintable(" to " + model));
47 47
48 - QScopedPointer<Transform> trainingWrapper(Transform::make("DirectStream([Identity])", NULL)); 48 + QScopedPointer<Transform> trainingWrapper(Transform::make("DirectStream([Identity], readMode=DistributeFrames)", NULL));
49 CompositeTransform * downcast = dynamic_cast<CompositeTransform *>(trainingWrapper.data()); 49 CompositeTransform * downcast = dynamic_cast<CompositeTransform *>(trainingWrapper.data());
50 if (downcast == NULL) 50 if (downcast == NULL)
51 qFatal("downcast failed?"); 51 qFatal("downcast failed?");
openbr/plugins/openbr_internal.h
1 #ifndef OPENBR_INTERNAL_H 1 #ifndef OPENBR_INTERNAL_H
2 #define OPENBR_INTERNAL_H 2 #define OPENBR_INTERNAL_H
3 3
  4 +#include <QMetaProperty>
  5 +
4 #include "openbr/openbr_plugin.h" 6 #include "openbr/openbr_plugin.h"
5 #include "openbr/core/resource.h" 7 #include "openbr/core/resource.h"
6 8
@@ -260,9 +262,27 @@ public: @@ -260,9 +262,27 @@ public:
260 newTransform = true; 262 newTransform = true;
261 263
262 QString name = metaObject()->className(); 264 QString name = metaObject()->className();
  265 +
263 name.replace("Transform",""); 266 name.replace("Transform","");
264 - name += "([])"; 267 + name += "([";
  268 + name += "],";
  269 +
  270 + QStringList parameters;
  271 +
  272 + // Skip name and transforms (handled below)
  273 + for (int i = 2; i < metaObject()->propertyCount();i++) {
  274 + QMetaProperty property = metaObject()->property(i);
  275 + parameters.append(property.read(this).toString());
  276 + }
  277 +
  278 + name += parameters.join(",");
  279 +
  280 + name += ")";
  281 +
265 name.replace("br::",""); 282 name.replace("br::","");
  283 +
  284 + qDebug() << name;
  285 +
266 CompositeTransform * output = dynamic_cast<CompositeTransform *>(Transform::make(name, NULL)); 286 CompositeTransform * output = dynamic_cast<CompositeTransform *>(Transform::make(name, NULL));
267 287
268 if (output == NULL) 288 if (output == NULL)
openbr/plugins/quality.cpp
@@ -179,6 +179,9 @@ class MatchProbabilityDistance : public Distance @@ -179,6 +179,9 @@ class MatchProbabilityDistance : public Distance
179 } 179 }
180 } 180 }
181 181
  182 + qDebug() << "Genuines:" << genuineScores;
  183 + qDebug() << "Impostors:" << impostorScores;
  184 +
182 mp = MP(genuineScores, impostorScores); 185 mp = MP(genuineScores, impostorScores);
183 } 186 }
184 187
openbr/plugins/stream.cpp
@@ -253,6 +253,8 @@ public: @@ -253,6 +253,8 @@ public:
253 253
254 bool getNextTemplate(Template & output) 254 bool getNextTemplate(Template & output)
255 { 255 {
  256 + qDebug() << "Next as video";
  257 +
256 if (!isOpen()) { 258 if (!isOpen()) {
257 qDebug("video source is not open"); 259 qDebug("video source is not open");
258 return false; 260 return false;
@@ -1058,7 +1060,9 @@ public: @@ -1058,7 +1060,9 @@ public:
1058 if (src.empty()) 1060 if (src.empty())
1059 return; 1061 return;
1060 1062
1061 - bool res = readStage->dataSource.open(src,readMode); 1063 + qDebug() << "Reading with mode:" << readMode;
  1064 +
  1065 + bool res = readStage->dataSource.open(src,br::Idiocy::DistributeFrames);
1062 if (!res) { 1066 if (!res) {
1063 qDebug("stream failed to open %s", qPrintable(dst[0].file.name)); 1067 qDebug("stream failed to open %s", qPrintable(dst[0].file.name));
1064 return; 1068 return;
@@ -1206,6 +1210,8 @@ public: @@ -1206,6 +1210,8 @@ public:
1206 // And the collection stage points to the read stage, because this is 1210 // And the collection stage points to the read stage, because this is
1207 // a ring buffer. 1211 // a ring buffer.
1208 collectionStage->nextStage = readStage; 1212 collectionStage->nextStage = readStage;
  1213 +
  1214 + qDebug() << "Init Readmode:" << readMode;
1209 } 1215 }
1210 1216
1211 DirectStreamTransform() 1217 DirectStreamTransform()
@@ -1323,6 +1329,7 @@ public: @@ -1323,6 +1329,7 @@ public:
1323 basis.activeFrames = this->activeFrames; 1329 basis.activeFrames = this->activeFrames;
1324 basis.readMode = this->readMode; 1330 basis.readMode = this->readMode;
1325 1331
  1332 + qDebug() << basis.readMode;
1326 // We need at least a CompositeTransform * to acess transform's children. 1333 // We need at least a CompositeTransform * to acess transform's children.
1327 CompositeTransform * downcast = dynamic_cast<CompositeTransform *> (transform); 1334 CompositeTransform * downcast = dynamic_cast<CompositeTransform *> (transform);
1328 1335