diff --git a/openbr/openbr_plugin.cpp b/openbr/openbr_plugin.cpp index 09a9e56..6470fff 100644 --- a/openbr/openbr_plugin.cpp +++ b/openbr/openbr_plugin.cpp @@ -763,11 +763,18 @@ void Object::setProperty(const QString &name, QVariant value) if (value.isNull()) value = true; else if (value == "false") value = false; else if (value == "true") value = true; + } else if (type.startsWith("br::") /* Pray to science it's safe to assume these are enums */) { + bool ok; + int enumIndex = value.toInt(&ok); + if (ok) { + QMetaEnum metaEnum = metaObject()->enumerator(metaObject()->indexOfEnumerator(type.toStdString().c_str())); + value = metaEnum.value(enumIndex); + } } if (!QObject::setProperty(qPrintable(name), value) && !type.isEmpty()) - qFatal("Failed to set %s::%s to: %s", - metaObject()->className(), qPrintable(name), qPrintable(value.toString())); + qFatal("Failed to set %s %s::%s to: %s", + qPrintable(type), metaObject()->className(), qPrintable(name), qPrintable(value.toString())); } QStringList Object::parse(const QString &string, char split) diff --git a/openbr/plugins/openbr_internal.h b/openbr/plugins/openbr_internal.h index 786272a..262e32e 100644 --- a/openbr/plugins/openbr_internal.h +++ b/openbr/plugins/openbr_internal.h @@ -264,8 +264,7 @@ public: QString name = metaObject()->className(); name.replace("Transform",""); - name += "(["; - name += "],"; + name += "([],"; QStringList parameters; @@ -278,11 +277,8 @@ public: 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 78dd0d2..7df4b54 100644 --- a/openbr/plugins/quality.cpp +++ b/openbr/plugins/quality.cpp @@ -179,9 +179,6 @@ 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 ccf39e0..618ba18 100644 --- a/openbr/plugins/stream.cpp +++ b/openbr/plugins/stream.cpp @@ -253,8 +253,6 @@ public: bool getNextTemplate(Template & output) { - qDebug() << "Next as video"; - if (!isOpen()) { qDebug("video source is not open"); return false; @@ -1060,8 +1058,6 @@ public: if (src.empty()) return; - 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)); @@ -1210,8 +1206,6 @@ public: // And the collection stage points to the read stage, because this is // a ring buffer. collectionStage->nextStage = readStage; - - qDebug() << "Init Readmode:" << readMode; } DirectStreamTransform() @@ -1329,7 +1323,6 @@ 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);