diff --git a/openbr/core/eval.cpp b/openbr/core/eval.cpp index d83f8f5..9a4da29 100644 --- a/openbr/core/eval.cpp +++ b/openbr/core/eval.cpp @@ -464,11 +464,10 @@ QList getDetections(QString key, const Template &t, bool isList, bool dets.append(Detection(rects.at(i), confidences.at(i))); } } else { - if (isTruth) { + if (isTruth) dets.append(Detection(f.get(key))); - } else { + else dets.append(Detection(f.get(key), f.get("Confidence", -1))); - } } return dets; } diff --git a/openbr/openbr_plugin.h b/openbr/openbr_plugin.h index 609610b..f983238 100644 --- a/openbr/openbr_plugin.h +++ b/openbr/openbr_plugin.h @@ -233,9 +233,9 @@ struct BR_EXPORT File template T get(const QString &key) const { - if (!contains(key)) qFatal("Missing key: %s", qPrintable(key)); + if (!contains(key)) qFatal("Missing key: %s in: %s", qPrintable(key), qPrintable(flat())); QVariant variant = value(key); - if (!variant.canConvert()) qFatal("Can't convert: %s", qPrintable(key)); + if (!variant.canConvert()) qFatal("Can't convert: %s in: %s", qPrintable(key), qPrintable(flat())); return variant.value(); } @@ -256,11 +256,11 @@ struct BR_EXPORT File template QList getList(const QString &key) const { - if (!contains(key)) qFatal("Missing key: %s", qPrintable(key)); + if (!contains(key)) qFatal("Missing key: %s in: %s", qPrintable(key), qPrintable(flat())); QList list; foreach (const QVariant &item, m_metadata[key].toList()) { if (item.canConvert()) list.append(item.value()); - else qFatal("Failed to convert value for key %s.", qPrintable(key)); + else qFatal("Failed to convert value for key %s in: %s", qPrintable(key), qPrintable(flat())); } return list; }