diff --git a/openbr/plugins/metadata/verifydetection.cpp b/openbr/plugins/metadata/verifydetection.cpp index 855ab24..b5e1b92 100644 --- a/openbr/plugins/metadata/verifydetection.cpp +++ b/openbr/plugins/metadata/verifydetection.cpp @@ -21,29 +21,33 @@ namespace br /*! * \ingroup transforms - * \brief Check if a the automated face detection contains the landmarks correpsonding + * \brief Check if a the automated face detection contains the landmarks corresponding * to the tempate metadata. If not, drop the template. This is meant for use - * during training, where the landmarks will be ground truth'd. If one wants to + * during training, where the landmarks will be ground truth'd. If one wants to * using a ground truth bounding box instead, then convert the BB to a landmark. - * \br_property int index Index of the landmark to be used. + * \br_property int index Index of the landmark to be used. + * \br_property QString inputVariable Metadata key for the rect. * \author Brendan Klare \cite bklare */ class VerifyDetectionTransform : public UntrainableMetaTransform { Q_OBJECT Q_PROPERTY(int index READ get_index WRITE set_index RESET reset_index STORED false) + Q_PROPERTY(QString inputVariable READ get_inputVariable WRITE set_inputVariable RESET reset_inputVariable STORED false) BR_PROPERTY(int, index, 14) + BR_PROPERTY(QString, inputVariable, "Face") - void project(const Template &, Template &dst) const + void project(const Template &src, Template &dst) const { - qWarning("Single template project not supported by VerifyDetectionTransform."); - dst.file.fte = true; + TemplateList temp; + project(TemplateList() << src, temp); + if (!temp.isEmpty()) dst = temp.first(); } void project(const TemplateList &src, TemplateList &dst) const { - for (int i = 0; i < src.size(); i++) - if (src[i].file.get("FrontalFace").contains(src[i].file.points()[index])) + for (int i = 0; i < src.size(); i++) + if (src[i].file.get(inputVariable).contains(src[i].file.points()[index])) dst.append(src[i]); } };