Opencv_traincascade failing on precalculation for negatives

asked 2016-12-10 12:20:43 -0600

stephenc gravatar image

updated 2016-12-10 23:08:42 -0600

I have tried several times now to use opencv_traincascade (using vc12 and vc11 from Windows build), but I keep running into the error:

BEGIN

POS count : consumed 40 : 40

Train dataset for temp stage can not be filled. Branch training terminated.

What is odd is that this error seems to occur at different stages. I have tinkered with my command, varying a number of the different parameters and the one that results in the most change is varying -numNeg. The more I reduce -numNeg, the higher number of stages will be computed.

So, I started to suspect that maybe I had an issue with end of file and I just needed to lower the number of negatives to be: totalNumNeg (297) / desiredNumStages.

So, I tried lowering the -numNeg to 5. With -featureType LBP I was able to get through 9 stages and successfully complete, but the final NEG cont : acceptance Ratio was 5 : 0.185185 (command: opencv_traincascade.exe -data C:\Training\data -vec C:\Training\titles.vec -bg C:\Training\negatives.txt -numStages 10 -numPos 40 -numNeg 5 -w 112 -h 20 -featureType LBP)

Then, for kicks and giggles I tried to do -featureType HAAR with the same parameters otherwise. This time it only made it through stage 2. The NEG count : acceptanceRatio was 5 : 0.0202429 on Stage 2. (command: opencv_traincascade.exe -data C:\Training\data -vec C:\Training\titles.vec -bg C:\Training\negatives.txt -numStages 10 -numPos 40 -numNeg 5 -w 112 -h 20 -featureType HAAR)

Since, I didn't change the -numNeg and it still failed using HAAR instead of LBP, that leads me to believe that it has something to do with the acceptanceRatio. Is it possible that I am hitting a weird error after achieving some level of accuracy?

Only once, I got this finish instead: BEGIN POS count : consumed 40 : 40 NEG count : acceptanceRatio 4 : 0.025 Required leaf false alarm rate achieved. Branch training terminated.

with the command: opencv_traincascade.exe -data C:\Training\data -vec C:\Training\titles.vec -bg C:\Training\negatives.txt -numStages 5 -numPos 40 -numNeg 45 -w 112 -h 20 -featureType LBP

Any advice would be greatly appreciated. Urgency is appreciated. I have spent every free moment this week trying to get this working and my final project is due next Friday. Thanks!

edit retag flag offensive close merge delete

Comments

The corresponding FAQ: About traincascade paremeters, samples, and other and other related topics you can find using the search bar.

Eduardo gravatar imageEduardo ( 2016-12-10 19:34:55 -0600 )edit

Thanks! Unfortunately, that question doesn't help me answer mine.

stephenc gravatar imagestephenc ( 2016-12-10 22:47:00 -0600 )edit