Commit 8917c95933efd5f5bd489a8dd745656e53cc2b3a
1 parent
be996aac
Remove all partition training data when training distances
Showing
2 changed files
with
4 additions
and
0 deletions
openbr/core/core.cpp
| ... | ... | @@ -65,6 +65,9 @@ struct AlgorithmCore |
| 65 | 65 | downcast->train(data); |
| 66 | 66 | |
| 67 | 67 | if (!distance.isNull()) { |
| 68 | + if (Globals->crossValidate > 0) | |
| 69 | + for (int i=data.size()-1; i>=0; i--) if (data[i].file.get<bool>("allPartitions",false)) data.removeAt(i); | |
| 70 | + | |
| 68 | 71 | qDebug("Projecting Enrollment"); |
| 69 | 72 | downcast->projectUpdate(data,data); |
| 70 | 73 | ... | ... |
openbr/plugins/validate.cpp
| ... | ... | @@ -108,6 +108,7 @@ class CrossValidateTransform : public MetaTransform |
| 108 | 108 | // If we want to duplicate templates but use the same training data |
| 109 | 109 | // for all partitions (i.e. transforms.size() == 1), we need to |
| 110 | 110 | // restrict the partition |
| 111 | + | |
| 111 | 112 | int partition = src.file.get<int>("Partition", 0); |
| 112 | 113 | partition = (partition >= transforms.size()) ? 0 : partition; |
| 113 | 114 | transforms[partition]->project(src, dst); | ... | ... |