From 11e30e272138ae38211d984e71b0b4f6b4cda239 Mon Sep 17 00:00:00 2001 From: Scott Klum Date: Thu, 2 May 2019 17:50:34 -0600 Subject: [PATCH] Minor boosting tweaks --- openbr/core/boost.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/openbr/core/boost.cpp b/openbr/core/boost.cpp index 325cd21..ff06286 100644 --- a/openbr/core/boost.cpp +++ b/openbr/core/boost.cpp @@ -582,11 +582,9 @@ void CascadeBoostTrainData::get_ord_var_data( CvDTreeNode* n, int vi, float* ord // For this feature, have we precalculated all of the feature responses? if (vi < numPrecalcVal) { - for (int i = 0; i < nodeSampleCount; i++) { - int idx = (*sortedIndices)[i]; - idx = sampleIndices[idx]; - ordValuesBuf[i] = valCache.at(vi, idx); - } + float *p = valCache.ptr(vi); + for (int i = 0; i < nodeSampleCount; i++) + ordValuesBuf[i] = p[sampleIndices[(*sortedIndices)[i]]]; } else { for (int i = 0; i < nodeSampleCount; i++) { int idx = (*sortedIndices)[i]; @@ -762,7 +760,7 @@ void CascadeBoostTrainData::precalculate() parallel_for_(Range(minPrecalc, numPrecalcVal), FeaturePrecalc(featureEvaluator, &valCache, sample_count)); - cout << "Precalculation time (ms): " << time.elapsed() << endl; + cout << "Precalculation time (min): " << time.elapsed()/1000/60. << endl; } //-------------------------------- CascadeBoostTree ---------------------------------------- -- libgit2 0.21.4