From c3fff4cfab7ac18f9f8c740c6de27e675f272fad Mon Sep 17 00:00:00 2001 From: Austin Blanton Date: Tue, 15 Oct 2013 15:33:07 -0400 Subject: [PATCH] Use the wonderful File::getList --- openbr/core/eval.cpp | 6 ++++-- openbr/plugins/slidingwindow.cpp | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/openbr/core/eval.cpp b/openbr/core/eval.cpp index 9850ab5..10fb99e 100644 --- a/openbr/core/eval.cpp +++ b/openbr/core/eval.cpp @@ -435,9 +435,11 @@ QList getDetections(QString key, const Template &t, bool isList, bool QList dets; if (isList) { QList rects = f.rects(); - QList confidences = QtUtils::toFloats(f.get("Confidences", QStringList())); + QList confidences; + if (f.contains("Confidences")) + confidences = f.getList("Confidences"); if (!isTruth && rects.size() != confidences.size()) - qFatal("You don't have enough confidence. I mean, your detections don't have confidence measures."); + qFatal("You don't have enough confidence. I mean, your detections don't all have confidence measures."); for (int i=0; i("Label") == "pos") { dst.file.appendRect(OpenCVUtils::fromRect(window)); float confidence = detect.file.get("Dist"); - QList confidences = dst.file.get >("Confidences", QList()); + QList confidences; + if (dst.file.contains("Confidences")) + confidences = dst.file.getList("Confidences"); confidences.append(confidence); dst.file.set("Confidences", QtUtils::toVariantList(confidences)); if (takeLargestScale) return; -- libgit2 0.21.4