opencv train cascade in less than 2 hours

asked 2015-12-31 14:41:47 -0600

Red Viper gravatar image

I'm new to opencv I want to detect a fire object and I'm training a fire classifier using opencv traincascade, as I read various tutorials everyone said that training will use up days or even weeks.

I have 700 positives and 3k negatives, I read that I should not use all positive to train and ratio of 1:2 in positive negative so this is what I inputted

opencv_traincascade -data classifier -positive.vec -bg negatives.txt -numPos 500 -numNeg 1000 -numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -precalcValBufSize 1024\ -precalcIdxBufSize 1024 -mode ALL PAUSE

the training only took 2 hours, Do I need to worry about it? is there something wrong with my samples?

edit retag flag offensive close merge delete

Comments

1

training duration will depend on your dataset and parameters,it is true that you should not use all your positive samples in your .vec file since the algorithm will need more positive samples as you progress deeper in stages but i am not quite sure about the 1:2 ratio between positive and negative samples since i am not strictly following this rule in my attempts to train a cascaded classifier and get satisfied with the results. just test the end classifier with some test data and take notes;what does not satisfy you? if you have lots of false positives try increasing your numNeg parameter or reduce the maxFalseAlarm parameter or increase the numStages parameter,if you suffer from false negatives try increasing your positive samples.

can gravatar imagecan ( 2016-01-01 01:27:49 -0600 )edit