From 2f14b079ea5c7e645d870ca385436b4c176ad9c1 Mon Sep 17 00:00:00 2001 From: Brendan Klare Date: Tue, 10 Dec 2013 12:22:31 -0500 Subject: [PATCH] Allows project to occur when training other transforms --- openbr/plugins/slidingwindow.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openbr/plugins/slidingwindow.cpp b/openbr/plugins/slidingwindow.cpp index 7d3a410..b53272c 100644 --- a/openbr/plugins/slidingwindow.cpp +++ b/openbr/plugins/slidingwindow.cpp @@ -56,9 +56,11 @@ class SlidingWindowTransform : public MetaTransform private: int windowHeight; + bool skipProject; void train(const TemplateList &data) { + skipProject = true; float aspectRatio = data.first().file.get("aspectRatio", -1); if (aspectRatio == -1) aspectRatio = getAspectRatio(data); @@ -104,7 +106,7 @@ protected: void projectHelp(const TemplateList &src, TemplateList &dst, int windowWidth, int windowHeight, float scale = 1) const { // no need to slide a window over ground truth data - if (src.first().file.getBool("Train", false)) { + if (skipProject) { dst = src; return; } @@ -243,9 +245,11 @@ class BuildScalesTransform : public MetaTransform private: float aspectRatio; int windowHeight; + bool skipProject; void train(const TemplateList &data) { + skipProject = true; aspectRatio = getAspectRatio(data); windowHeight = qRound(windowWidth / aspectRatio); if (transform->trainable) { @@ -268,7 +272,7 @@ private: void project(const TemplateList &src, TemplateList &dst) const { // do not scale images during training - if (src.first().file.getBool("Train", false)) { + if (skipProject) { dst = src; return; } -- libgit2 0.21.4