From 6a1fa9902b319ca4ebe08210a26ac6a71851257e Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Tue, 2 Jul 2013 19:12:02 -0400 Subject: [PATCH] Update Classifier::_classify to reflect changes to label handling --- openbr/gui/classifier.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/openbr/gui/classifier.cpp b/openbr/gui/classifier.cpp index 8dcf0c6..71a3102 100644 --- a/openbr/gui/classifier.cpp +++ b/openbr/gui/classifier.cpp @@ -39,19 +39,23 @@ void Classifier::_classify(File file) { QString key, value; foreach (const File &f, Enroll(file.flat(), File("[algorithm=" + algorithm + "]"))) { - if (!f.contains("Label")) - continue; if (algorithm == "GenderClassification") { key = "Gender"; - value = f.get(key); } else if (algorithm == "AgeRegression") { key = "Age"; - value = QString::number(int(f.get(key)+0.5)) + " Years"; } else { key = algorithm; - value = f.get("Label"); } + + if (!f.contains(key)) + continue; + + if (algorithm == "AgeRegression") + value = QString::number(int(f.get(key)+0.5)) + " Years"; + else + value = f.get(key); + break; } -- libgit2 0.21.4