traincascade stops every time at stage 5 or less,

asked 2014-08-13 04:27:21 -0500

Punith K gravatar image

updated 2014-08-13 04:28:05 -0500

I want to know clearly,Is there any hard rule to chose the number of positive and negative samples so that training never stops in between.

I did follow the new Train Cascade method over the same sample, but it stuck as well at stage 5. I found that there is one equation for number of files to be there in vec file. I could not able to achieve that since while creating samples I could not able to create as many I want. It always creates one less than the number of positive samples I have in my positive folder. I tried both method i.e haar training and train cascade methods, for the same dataset positive=1000 and negative=2000. and false alarm rate=0.499 and mishitrate=0.95.

I use, $opencv_haartraining -data data -vec samples.vec -bg negatives.txt -nstages 3 -nsplits 2 -minhitrate 0.999 -maxfalsealarm 0.5 -npos 1000 -nneg 2000 -w 100 -h 40 -nonsym -mem 1024 -mode ALL runs well till stage 5 then it stops ( doesn't move even a bit, i waited more than 12 hours to see progress, but no progress noticed, then gave up waiting).

@StevenPuttemans

edit retag flag offensive close merge delete

Comments

Like said before, your question stays quite unclear. Could you start by giving examples of the data supplied, the traincascade command used, the first part where createsamples is going loco. How are people to know what to answer if you make it a guessing game :P

StevenPuttemans gravatar imageStevenPuttemans ( 2014-08-13 06:30:22 -0500 )edit

@StevenPuttemans Clearly, I use

find ./positive -name '*.jpg' -exec echo {} 1 0 0 <width> <height> \; > file.info , to create info file

then

find ./negative -name '*.jpg' > bg.txt,

opencv_createsamples -info file.info -num 1000 -w 100 -h 40 -vec data.vec

finally,

opencv_traincascade -data data -vec data.vec -bg bg.txt -numStages 20 -nsplits 2 -minhitrate 0.95 -maxfalsealarm 0.5 -numPos 1000 -numNeg 2000 -w 100 -h 40

It runs for few stages, may for stage 4, then it stops.

Punith K gravatar imagePunith K ( 2014-08-16 02:17:54 -0500 )edit