Commit 6a9e4eb0d93342e46fd3072fbc67cd55e4b7120f
1 parent
497ea0d4
Update stream::train to separate the training templates, similar to what happens in stream::project
Showing
1 changed file
with
8 additions
and
1 deletions
openbr/plugins/stream.cpp
| @@ -1285,11 +1285,18 @@ public: | @@ -1285,11 +1285,18 @@ public: | ||
| 1285 | qWarning("Attempted to train untrainable transform, nothing will happen."); | 1285 | qWarning("Attempted to train untrainable transform, nothing will happen."); |
| 1286 | return; | 1286 | return; |
| 1287 | } | 1287 | } |
| 1288 | + QList<TemplateList> separated; | ||
| 1289 | + foreach (const TemplateList & list, data) { | ||
| 1290 | + foreach(const Template & t, list) { | ||
| 1291 | + separated.append(TemplateList()); | ||
| 1292 | + separated.last().append(t); | ||
| 1293 | + } | ||
| 1294 | + } | ||
| 1288 | 1295 | ||
| 1289 | for (int i=0; i < transforms.size(); i++) { | 1296 | for (int i=0; i < transforms.size(); i++) { |
| 1290 | // OK we have a trainable transform, we need to get input data for it. | 1297 | // OK we have a trainable transform, we need to get input data for it. |
| 1291 | if (transforms[i]->trainable) { | 1298 | if (transforms[i]->trainable) { |
| 1292 | - QList<TemplateList> copy = data; | 1299 | + QList<TemplateList> copy = separated; |
| 1293 | // Project from the start to the trainable stage. | 1300 | // Project from the start to the trainable stage. |
| 1294 | subProject(copy,i); | 1301 | subProject(copy,i); |
| 1295 | 1302 |