From 5cd55024289b93aa6ab491f3e14c344691790016 Mon Sep 17 00:00:00 2001 From: Scott Klum Date: Mon, 30 Dec 2013 17:05:30 -0500 Subject: [PATCH] Removed Train flag logic from crossValidate to facilitate training distances properly --- openbr/plugins/independent.cpp | 4 ++-- openbr/plugins/quality.cpp | 2 +- openbr/plugins/validate.cpp | 16 +++++++--------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/openbr/plugins/independent.cpp b/openbr/plugins/independent.cpp index 4a1ec03..156cc75 100644 --- a/openbr/plugins/independent.cpp +++ b/openbr/plugins/independent.cpp @@ -156,8 +156,8 @@ class IndependentTransform : public MetaTransform QFutureSynchronizer futures; for (int i=0; idata.at(i, j); if (score == -std::numeric_limits::max()) continue; - if (crossModality) if(src[i].file.get("MODALITY") == src[j].file.get("MODALITY")) continue; + if (crossModality && src[i].file.get("MODALITY") == src[j].file.get("MODALITY")) continue; if (labels[i] == labels[j]) genuineScores.append(score); else impostorScores.append(score); } diff --git a/openbr/plugins/validate.cpp b/openbr/plugins/validate.cpp index 0774565..d1f1dc0 100644 --- a/openbr/plugins/validate.cpp +++ b/openbr/plugins/validate.cpp @@ -104,15 +104,13 @@ class CrossValidateTransform : public MetaTransform // since it is assumed that the allPartitions // flag is only used during comparison // (i.e. only used when making a mask) - if (src.file.getBool("Train", false)) dst = src; - else { - // If we want to duplicate templates but use the same training data - // for all partitions (i.e. transforms.size() == 1), we need to - // restrict the partition - int partition = src.file.get("Partition", 0); - partition = (partition >= transforms.size()) ? 0 : partition; - transforms[partition]->project(src, dst); - } + + // If we want to duplicate templates but use the same training data + // for all partitions (i.e. transforms.size() == 1), we need to + // restrict the partition + int partition = src.file.get("Partition", 0); + partition = (partition >= transforms.size()) ? 0 : partition; + transforms[partition]->project(src, dst); } void store(QDataStream &stream) const -- libgit2 0.21.4