Ask Your Question
0

opencv_traincascade always halts on stage 4.i

asked 2016-10-06 05:11:47 -0600

prala123 gravatar image

While trying to train a cascade classifier opencv_traincascade process always halts at stage 4.

I have 7358 of negative samples. where i list their relative path in the negative_samples file, and I have 17600 positive samples in the positives.vec file.

opencv_traincascade -data cascade -vec samples/positives.vec -bg negative_samples -numStages 20 -precalcValBufSize 10 -precalcIdxBufSize 200 -acceptanceRatioBreakValue 0.0001 -w 50 -h 50 -mode ALL -maxWeakCount 100 -maxDepth 1 -weightTrimRate 0.95

here is the console output

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-10-07 03:48:13 -0600

Ok there are some major issues with your command

  • -precalcValBufSize 10 -precalcIdxBufSize 200 you do know that this will slow down the training incredibly? You are limiting the memory to a single 10 bites ... which seems plain wrong. Try setting it at default values which are 1024 at least! 1GB of memory is available on most systems these days.
  • You POS:NEG rate seems wrong to me. Normally the background has more variance then the object class. So you should use a ration of 1:2 at least.
  • The fact that it is halting is that it cannot read new negative samples it seems. Can you ensure that all paths of the file are actually readable?
edit flag offensive delete link more

Comments

1

Yeah trouble was exactly that my pos neg ratio was not the recommended. And some samples did not have the path correct, you are right. Now it is working, and it is on stage 7 ... yay. Thanks for the reply.

prala123 gravatar imageprala123 ( 2016-10-07 04:10:43 -0600 )edit

You are welcome.

StevenPuttemans gravatar imageStevenPuttemans ( 2016-10-07 06:08:20 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-10-06 05:11:47 -0600

Seen: 137 times

Last updated: Oct 07 '16