0

I have made a classifier before and didn't have any issues with the opencv_traincascade. I set the numstage at 10, and should expect training 9-stage. However, it surpasses 10 and got killed at training 16-stage.

I looked at my parameters and noticed that the numstage was 20 instead of 10... as what I have shown below.

May someone explain, what I am doing wrong? Why is the parameters saying numstage 20 when I only wanted 10?

/workspace$ opencv_traincascade -data data -vec p.vec -bg bg2.txt -numPos 250 -numNeg 800 numstages 10 -w 50 -h 150

Training parameters are pre-loaded from the parameter file in data folder! 
Please empty this folder if you want to use a NEW set of training parameters.

PARAMETERS:
cascadeDirName: data
vecFileName: p.vec
bgFileName: bg2.txt
numPos: 250
numNeg: 800
numStages: 20  <-- *******THIS ONE!********
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
acceptanceRatioBreakValue : -1
stageType: BOOST
featureType: HAAR
sampleWidth: 50
sampleHeight: 150
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: BASIC

Stages 0-15 are loaded

===== TRAINING 16-stage =====
<BEGIN
POS count : consumed   250 : 260
  • use a different working directory from where you start the training. Probably you copy pasted a previous one or sth? Delete all unnecessary files/folders – Micka Jul 02 '18 at 20:09
  • looks like there are already 16 trained stages present.. – Micka Jul 02 '18 at 20:10
  • Thanks Micka for the reply.! I have done that as well, but it is still giving me showing 20, even when I only wanted 10! – koonkie Jul 02 '18 at 22:42
  • does it still show "Stages 0-15 are loaded"? Have a look at all folders in your PATH variable or other globally available folders, whether training result data is present there and remove it. – Micka Jul 03 '18 at 04:37
  • No it doesn't show stages 0 -15.... but, the numstages is still 20 even when I only wanted 10 numstages. – koonkie Jul 03 '18 at 13:10

1 Answers1

0

you missed the "-" before numstages (and maybe capital letter, not sure) so the application uses default value 20

please try

opencv_traincascade -data data -vec p.vec -bg bg2.txt -numPos 250 -numNeg 800 -numStages 10 -w 50 -h 150
Micka
  • 19,585
  • 4
  • 56
  • 74