Commit 084ec93f4cb53a65008db213bbe3c101197c2d09
1 parent
8a62b8b4
windows compile fix
Showing
2 changed files
with
6 additions
and
9 deletions
openbr/core/boost.cpp
| @@ -788,14 +788,17 @@ void CascadeBoostTrainData::precalculate() | @@ -788,14 +788,17 @@ void CascadeBoostTrainData::precalculate() | ||
| 788 | { | 788 | { |
| 789 | int minNum = MIN( numPrecalcVal, numPrecalcIdx); | 789 | int minNum = MIN( numPrecalcVal, numPrecalcIdx); |
| 790 | 790 | ||
| 791 | - double proctime = -TIME( 0 ); | 791 | + QTime time; |
| 792 | + time.start(); | ||
| 793 | + | ||
| 792 | parallel_for_( Range(numPrecalcVal, numPrecalcIdx), | 794 | parallel_for_( Range(numPrecalcVal, numPrecalcIdx), |
| 793 | FeatureIdxOnlyPrecalc(featureEvaluator, buf, sample_count, is_buf_16u!=0) ); | 795 | FeatureIdxOnlyPrecalc(featureEvaluator, buf, sample_count, is_buf_16u!=0) ); |
| 794 | parallel_for_( Range(0, minNum), | 796 | parallel_for_( Range(0, minNum), |
| 795 | FeatureValAndIdxPrecalc(featureEvaluator, buf, &valCache, sample_count, is_buf_16u!=0) ); | 797 | FeatureValAndIdxPrecalc(featureEvaluator, buf, &valCache, sample_count, is_buf_16u!=0) ); |
| 796 | parallel_for_( Range(minNum, numPrecalcVal), | 798 | parallel_for_( Range(minNum, numPrecalcVal), |
| 797 | - FeatureValOnlyPrecalc(featureEvaluator, &valCache, sample_count) ); | ||
| 798 | - cout << "Precalculation time: " << (proctime + TIME( 0 )) << endl; | 799 | + FeatureValOnlyPrecalc(featureEvaluator, &valCache, sample_count) ); |
| 800 | + | ||
| 801 | + cout << "Precalculation time (ms): " << time.elapsed() << endl; | ||
| 799 | } | 802 | } |
| 800 | 803 | ||
| 801 | //-------------------------------- CascadeBoostTree ---------------------------------------- | 804 | //-------------------------------- CascadeBoostTree ---------------------------------------- |
openbr/core/boost.h
| @@ -4,12 +4,6 @@ | @@ -4,12 +4,6 @@ | ||
| 4 | #include "ml.h" | 4 | #include "ml.h" |
| 5 | #include <openbr/openbr_plugin.h> | 5 | #include <openbr/openbr_plugin.h> |
| 6 | 6 | ||
| 7 | -#ifdef _WIN32 | ||
| 8 | -#define TIME( arg ) (((double) clock()) / CLOCKS_PER_SEC) | ||
| 9 | -#else | ||
| 10 | -#define TIME( arg ) (time( arg )) | ||
| 11 | -#endif | ||
| 12 | - | ||
| 13 | namespace br | 7 | namespace br |
| 14 | { | 8 | { |
| 15 | 9 |