From e544b45abada4360b82c541730326c8e27212940 Mon Sep 17 00:00:00 2001 From: Tunde Date: Thu, 22 May 2014 16:46:12 -0400 Subject: [PATCH] Fixed using tabs instead of spaces, and added myself to the bib file --- openbr/plugins/gallery.cpp | 90 +++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------- share/openbr/openbr.bib | 6 ++++++ 2 files changed, 51 insertions(+), 45 deletions(-) diff --git a/openbr/plugins/gallery.cpp b/openbr/plugins/gallery.cpp index ae1ce51..db271dd 100644 --- a/openbr/plugins/gallery.cpp +++ b/openbr/plugins/gallery.cpp @@ -1033,47 +1033,47 @@ class topPredictionsGallery : public Gallery Q_PROPERTY(float out_count READ get_out_count WRITE set_out_count RESET reset_out_count STORED false) BR_PROPERTY(float, out_count, 3) - QMap attributes; + QMap attributes; ~topPredictionsGallery() { - QString result = QString("# of attributes: %1").arg(QString::number(attributes.count())); + QString result = QString("# of attributes: %1").arg(QString::number(attributes.count())); QtUtils::writeFile(file.name, result); if (!attributes.isEmpty()) - { - QMapIterator it(attributes); - it.toBack(); - if (out_count > 1) - { - if (attributes.count() < out_count) - out_count = attributes.count(); - - for (int i = 0; i < out_count; i++) - { - it.previous(); - result = QString("%1) %2 : %3").arg(QString::number(i + 1), it.value(), QString::number((float)it.key())); - QtUtils::writeFile(file.name, result); - } - } - else - { - int count = 0; - it.toBack(); - while (it.hasPrevious()) - { - it.previous(); - if (it.key() >= out_count) - { - result = QString("%1) %2 : %3").arg(QString::number(count + 1), it.value(), QString::number((float)it.key())); - QtUtils::writeFile(file.name, result); - count++; - } - } - } - } + { + QMapIterator it(attributes); + it.toBack(); + if (out_count > 1) + { + if (attributes.count() < out_count) + out_count = attributes.count(); + + for (int i = 0; i < out_count; i++) + { + it.previous(); + result = QString("%1) %2 : %3").arg(QString::number(i + 1), it.value(), QString::number((float)it.key())); + QtUtils::writeFile(file.name, result); + } + } + else + { + int count = 0; + it.toBack(); + while (it.hasPrevious()) + { + it.previous(); + if (it.key() >= out_count) + { + result = QString("%1) %2 : %3").arg(QString::number(count + 1), it.value(), QString::number((float)it.key())); + QtUtils::writeFile(file.name, result); + count++; + } + } + } + } } - //Pure virtial function so needs an implementation + //Pure virtial function so needs an implementation TemplateList readBlock(bool *done) { *done = true; @@ -1082,17 +1082,17 @@ class topPredictionsGallery : public Gallery void write(const Template &t) { - QList keys = t.file.localKeys(); - for (int i = 0; i < keys.count(); i++) - { - QString key = keys.at(i); - if (key.startsWith("predicted_")) - { - float val = t.file.get(key); - attributes.insert(val, key); //use float as key to keep in order - } - - } + QList keys = t.file.localKeys(); + for (int i = 0; i < keys.count(); i++) + { + QString key = keys.at(i); + if (key.startsWith("predicted_")) + { + float val = t.file.get(key); + attributes.insert(val, key); //use float as key to keep in order + } + + } } }; diff --git a/share/openbr/openbr.bib b/share/openbr/openbr.bib index 111cd1b..42a1563 100644 --- a/share/openbr/openbr.bib +++ b/share/openbr/openbr.bib @@ -400,3 +400,9 @@ booktitle={IEEE Conf. on Computer Vision and Pattern Recognition, 2011}, pages={513--520} } + +@misc{baba1472, + Author = {Babatunde Ogunfemi}, + Howpublished = {https://github.com/baba1472}, + Title = {ogunfemi.b at gmail.com}} + -- libgit2 0.21.4