From 04ecd5756fc02ba9754a029e8b186e2bca574e23 Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Fri, 2 Aug 2013 13:34:52 -0400 Subject: [PATCH] In pipe::Train, make timeVarying transforms project singleItemLists --- openbr/plugins/meta.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/openbr/plugins/meta.cpp b/openbr/plugins/meta.cpp index c8df4c5..b4cc865 100644 --- a/openbr/plugins/meta.cpp +++ b/openbr/plugins/meta.cpp @@ -104,22 +104,21 @@ class PipeTransform : public CompositeTransform fprintf(stderr, " training..."); transforms[i]->train(copy); } - // if the transform is time varying, we batch project it. + + // if the transform is time varying, we can't project it in parallel if (transforms[i]->timeVarying()) { fprintf(stderr, "\n%s projecting...", qPrintable(transforms[i]->objectName())); - transforms[i]->projectUpdate(copy, copy); + for (int j=0; j < singleItemLists.size();j++) + transforms[i]->projectUpdate(singleItemLists[j], singleItemLists[j]); // advance i since we already projected for this stage. i++; - // set up the single item lists since they are inconsistent again. - singleItemLists.clear(); - for (int j=0; j < copy.size(); j++) - { - TemplateList temp; - temp.append(copy[j]); - singleItemLists.append(temp); - } + // set up copy again + copy.clear(); + for (int j=0; j < singleItemLists.size(); j++) + copy.append(singleItemLists[j]); + // the next stage might be trainable, so continue to evaluate it. continue; } -- libgit2 0.21.4