From 725e25b445e6dbd171c1414a3626938f57298ace Mon Sep 17 00:00:00 2001 From: Scott Klum Date: Sat, 1 Mar 2014 12:38:51 -0500 Subject: [PATCH] Added some things related to leave one out cv --- openbr/core/bee.cpp | 4 ++++ openbr/openbr_plugin.cpp | 2 +- openbr/plugins/validate.cpp | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/openbr/core/bee.cpp b/openbr/core/bee.cpp index db67479..a429f92 100644 --- a/openbr/core/bee.cpp +++ b/openbr/core/bee.cpp @@ -305,11 +305,14 @@ cv::Mat BEE::makeMask(const br::FileList &targets, const br::FileList &queries, QList targetPartitions = targets.crossValidationPartitions(); QList queryPartitions = queries.crossValidationPartitions(); + QList targetsOnly = File::get(queries, "targetOnly", false); + Mat mask(queries.size(), targets.size(), CV_8UC1); for (int i=0; i("Partition")) { leaveOneImageOutTemplate.file.set("Partition", k); - leaveOneImageOutTemplate.file.set("testOnly", true); + leaveOneImageOutTemplate.file.set("targetOnly", true); newTemplates.insert(i+1,leaveOneImageOutTemplate); } } diff --git a/openbr/plugins/validate.cpp b/openbr/plugins/validate.cpp index f5eaf19..75bca83 100644 --- a/openbr/plugins/validate.cpp +++ b/openbr/plugins/validate.cpp @@ -65,9 +65,9 @@ class CrossValidateTransform : public MetaTransform const QString label = partitionedData.at(j).file.get("Label"); QList subjectIndices = partitionedData.find("Label",label); QList removed; - // Remove test only data + // Remove target only data for (int k=subjectIndices.size()-1; k>=0; k--) - if (partitionedData[subjectIndices[k]].file.getBool("testOnly")) { + if (partitionedData[subjectIndices[k]].file.getBool("targetOnly")) { removed.append(subjectIndices[k]); subjectIndices.removeAt(k); } -- libgit2 0.21.4