3

I am trying to train a Haar Classifier however during Stage 2 it stops with the message Killed

PARAMETERS:
cascadeDirName: classifier
vecFileName: samples.vec
bgFileName: negatives.txt
numPos: 500
numNeg: 964
numStages: 10
precalcValBufSize[Mb] : 2048
precalcIdxBufSize[Mb] : 2048
stageType: BOOST
featureType: HAAR
sampleWidth: 80
sampleHeight: 40
boostType: GAB
minHitRate: 0.999
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: ALL

Stages 0-1 are loaded

===== TRAINING 2-stage =====
<BEGIN
POS count : consumed   500 : 500
NEG count : acceptanceRatio    964 : 0.182992
Precalculation time: 49
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+
|   1|        1|        1|
+----+---------+---------+
|   2|        1|        1|
+----+---------+---------+
|   3|        1|        1|
+----+---------+---------+
|   4|        1|        1|
+----+---------+---------+
|   5|        1|  0.56639|
+----+---------+---------+
Killed

The command I am using to run is below:

opencv_traincascade -data classifier -vec samples.vec -bg negatives.txt  -numStages 10 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 500-nonsym -mem 512  -numNeg 964 -w 80 -h 40 -mode ALL -precalcValBufSize 2048  -precalcIdxBufSize 2048

What is causing this?

N.B: I am following the tutorial given here (replacing the images with a different object in different amounts).

Colin747
  • 4,955
  • 18
  • 70
  • 118

1 Answers1

0

Reducing the width and height in the opencv_traincascade command made the program run correctly.

Your -w 80 -h 40 is probably too high for your PC. A recommanded size should be -w 24 -h 24.

I noticed an high usage of hard drive while performing the command unless it's killed. Maybe our hard drives are not quick enough.

secavfr
  • 628
  • 1
  • 9
  • 24
  • I ran into same problem. with 143292 positive images and 65251 negative images. the `-w` is 80 and `-h` is 80. Now I am trying to do it with 24 & 24 default values. but I didnt understand the reason why that should work and not the 80 x 80. What is the explaination for this? – RC0993 Sep 27 '19 at 08:48