From 3b2f1a6404b011114e44aa61bde00785c5a997c2 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Mon, 25 Feb 2013 16:05:49 -0500 Subject: [PATCH] TemplateList::fromInput() updated to TemplateList::fromGallery() to reflect the fact that the Input class was generalized into the Gallery class a while ago. --- sdk/core/bee.cpp | 4 ++-- sdk/core/classify.cpp | 8 ++++---- sdk/core/cluster.cpp | 2 +- sdk/core/core.cpp | 4 ++-- sdk/openbr.cpp | 2 +- sdk/openbr_plugin.cpp | 10 +++++----- sdk/openbr_plugin.h | 3 ++- sdk/plugins/youtube.cpp | 4 ++-- 8 files changed, 19 insertions(+), 18 deletions(-) diff --git a/sdk/core/bee.cpp b/sdk/core/bee.cpp index 1cc8a61..3e6d5d1 100644 --- a/sdk/core/bee.cpp +++ b/sdk/core/bee.cpp @@ -227,8 +227,8 @@ void BEE::makeMask(const QString &targetInput, const QString &queryInput, const { qDebug("Making mask from %s and %s to %s", qPrintable(targetInput), qPrintable(queryInput), qPrintable(mask)); - FileList targetFiles = TemplateList::fromInput(targetInput).files(); - FileList queryFiles = TemplateList::fromInput(queryInput).files(); + FileList targetFiles = TemplateList::fromGallery(targetInput).files(); + FileList queryFiles = TemplateList::fromGallery(queryInput).files(); QList targetLabels = targetFiles.labels(); QList queryLabels = queryFiles.labels(); QList targetPartitions = targetFiles.crossValidationPartitions(); diff --git a/sdk/core/classify.cpp b/sdk/core/classify.cpp index 411b7d2..958f676 100644 --- a/sdk/core/classify.cpp +++ b/sdk/core/classify.cpp @@ -37,8 +37,8 @@ void br::EvalClassification(const QString &predictedInput, const QString &truthI { qDebug("Evaluating classification of %s against %s", qPrintable(predictedInput), qPrintable(truthInput)); - TemplateList predicted(TemplateList::fromInput(predictedInput)); - TemplateList truth(TemplateList::fromInput(truthInput)); + TemplateList predicted(TemplateList::fromGallery(predictedInput)); + TemplateList truth(TemplateList::fromGallery(truthInput)); if (predicted.size() != truth.size()) qFatal("Input size mismatch."); QHash counters; @@ -83,8 +83,8 @@ void br::EvalRegression(const QString &predictedInput, const QString &truthInput { qDebug("Evaluating regression of %s against %s", qPrintable(predictedInput), qPrintable(truthInput)); - const TemplateList predicted(TemplateList::fromInput(predictedInput)); - const TemplateList truth(TemplateList::fromInput(truthInput)); + const TemplateList predicted(TemplateList::fromGallery(predictedInput)); + const TemplateList truth(TemplateList::fromGallery(truthInput)); if (predicted.size() != truth.size()) qFatal("Input size mismatch."); float rmsError = 0; diff --git a/sdk/core/cluster.cpp b/sdk/core/cluster.cpp index cff658a..e3b0bcb 100644 --- a/sdk/core/cluster.cpp +++ b/sdk/core/cluster.cpp @@ -278,7 +278,7 @@ void br::EvalClustering(const QString &csv, const QString &input) { qDebug("Evaluating %s against %s", qPrintable(csv), qPrintable(input)); - QList labels = TemplateList::fromInput(input).files().labels(); + QList labels = TemplateList::fromGallery(input).files().labels(); QHash labelToIndex; int nClusters = 0; diff --git a/sdk/core/core.cpp b/sdk/core/core.cpp index beb33f6..b2868f5 100644 --- a/sdk/core/core.cpp +++ b/sdk/core/core.cpp @@ -40,7 +40,7 @@ struct AlgorithmCore void train(const File &input, const QString &model) { - TemplateList data(TemplateList::fromInput(input)); + TemplateList data(TemplateList::fromGallery(input)); if (transform.isNull()) qFatal("Null transform."); qDebug("%d training files", data.size()); @@ -118,7 +118,7 @@ struct AlgorithmCore if (!fileList.isEmpty() && gallery.contains("cache")) return fileList; - const TemplateList i(TemplateList::fromInput(input)); + const TemplateList i(TemplateList::fromGallery(input)); if (i.isEmpty()) return fileList; // Nothing to enroll if (transform.isNull()) qFatal("Null transform."); diff --git a/sdk/openbr.cpp b/sdk/openbr.cpp index 6ef8b21..a8897f9 100644 --- a/sdk/openbr.cpp +++ b/sdk/openbr.cpp @@ -204,7 +204,7 @@ void br_read_line(int *argc, const char ***argv) void br_reformat(const char *target_input, const char *query_input, const char *simmat, const char *output) { - Output::reformat(TemplateList::fromInput(target_input).files(), TemplateList::fromInput(query_input).files(), simmat, output); + Output::reformat(TemplateList::fromGallery(target_input).files(), TemplateList::fromGallery(query_input).files(), simmat, output); } const char *br_scratch_path() diff --git a/sdk/openbr_plugin.cpp b/sdk/openbr_plugin.cpp index acd55f9..212393a 100644 --- a/sdk/openbr_plugin.cpp +++ b/sdk/openbr_plugin.cpp @@ -445,14 +445,14 @@ QDataStream &br::operator>>(QDataStream &stream, Template &t) } /* TemplateList - public methods */ -TemplateList TemplateList::fromInput(const br::File &input) +TemplateList TemplateList::fromGallery(const br::File &gallery) { TemplateList templates; - foreach (const br::File &file, input.split()) { + foreach (const br::File &file, gallery.split()) { QScopedPointer i(Gallery::make(file)); TemplateList newTemplates = i->read(); - const int crossValidate = input.getInt("crossValidate"); + const int crossValidate = gallery.getInt("crossValidate"); if (crossValidate > 0) srand(0); // If file is a Format not a Gallery @@ -461,13 +461,13 @@ TemplateList TemplateList::fromInput(const br::File &input) // Propogate metadata for (int i=0; i 0) newTemplates[i].file.insert("Cross_Validation_Partition", rand()%crossValidate); } - if (!templates.isEmpty() && input.getBool("merge")) { + if (!templates.isEmpty() && gallery.getBool("merge")) { if (newTemplates.size() != templates.size()) qFatal("Inputs must be the same size in order to merge."); for (int i=0; i TemplateList() : uniform(false) {} TemplateList(const QList