Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Training HAAR classifier takes too long

$ traincascade.exe -data classifier1/ -vec samples.vec -bg negatives.txt -numPos 500 -numNeg 1134 -numStages 10 -precalcValBufSize 1024 -precalcIdxBufSize 1024 -featureType HAAR -w 40 -h 90 -minHitRate 0.995 -maxFalseAlarmRate 0.5 -mode ALL
PARAMETERS:
cascadeDirName: classifier1/
vecFileName: samples.vec
bgFileName: negatives.txt
numPos: 500
numNeg: 1134
numStages: 10
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
stageType: BOOST
featureType: HAAR
sampleWidth: 40
sampleHeight: 90
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: ALL

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed   500 : 500
NEG count : acceptanceRatio    1134 : 1
Precalculation time: 37.424
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+
|   1|        1|        1|
+----+---------+---------+
|   2|        1|        1|
+----+---------+---------+
|   3|    0.996| 0.622575|
+----+---------+---------+
|   4|    0.996| 0.622575|
+----+---------+---------+
|   5|    0.996| 0.623457|
+----+---------+---------+
|   6|    0.998|  0.55291|
+----+---------+---------+
|   7|    0.998| 0.568783|
+----+---------+---------+
|   8|    0.996| 0.539683|
+----+---------+---------+
|   9|    0.996| 0.428571|
+----+---------+---------+
END>
Training until now has taken 0 days **14 hours 15 minutes 46 seconds**.

===== TRAINING 1-stage =====
<BEGIN
POS count : consumed   500 : 502
NEG count : acceptanceRatio    1134 : 0.584838
Precalculation time: 38.191
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+
|   1|        1|        1|
+----+---------+---------+
|   2|        1|        1|
+----+---------+---------+

14 hours just for 1 stage, is it normal?

This is what my task manager shows. It seems to me all cores are working, but only 20% of my CPU is under load: image description image description

Is it possible to make it work faster?