Error in opencv_traincascade

asked 2015-03-24 00:25:55 -0600

Hi can you please help me, I'm getting an error while running the opencv_traincascade on Ubuntu 14.04 from the following script

#!/bin/sh
AS="/home/isat/HW_2"
opencv_traincascade -data $AS/trainCascade -vec $AS/full_vec.vec -bg $AS/negative_copy.txt -numStages 20 -nsplits 2 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 1000 -numNeg 9000 -w 20 -h 20 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 1024 -mem 14000

the error it gives is
POS count : consumed 1000 : 1000 Train dataset for temp stage can not be filled. Branch training terminated. Cascade classifier can't be trained. Check the used training parameters.

Which I realise is the issue of the bg description file not being interpreted properly. My directory structure is

HW_2
   negative_copy.txt
   /Negative
      neg_1.bmp
      neg_2.bmp

and my negative_copy.txt looks like

Negative/neg_1.bmp
Negative/neg_10.bmp
Negative/neg_100.bmp

since in the documentation it's written that the address must be relative to the directory of the description file. But I've tried everything from ./, to /Negative to absolute addresses and my terminal is running from / just to ensure that my relative and absolute paths are same as well. Kindly help me. I am at wit's end.

edit retag flag offensive close merge delete

Comments

I am seeing a similar notification. What puzzles me is that most of the discussions online that I have found most people are seeing this very early in the training process (like at the beginning - Stage 0). I have had 2 runs where one terminated at Stage 14 and another at Stage 15. All of the online discussion of this termination states that it has to do with some error in either the -bg parameter or the actual negatives.txt file itself. But in my case, since it got to a later stage, I have to assume it is something else. Right now I am trying to decipher the code base to determine what is causing this to happen for me. I will post something if I can figure it out.

Schawn gravatar imageSchawn ( 2015-03-25 07:10:16 -0600 )edit