Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRAINING 0-stage not moving forward #8

Open
morex87 opened this issue Jun 4, 2015 · 13 comments
Open

TRAINING 0-stage not moving forward #8

morex87 opened this issue Jun 4, 2015 · 13 comments

Comments

@morex87
Copy link

morex87 commented Jun 4, 2015

Hi, I'm using OSX 10.10.2 (brew)

The stages seems that are not moving forward
What is missing? Not error messages and the files already are in the respective folders

Here is what I did using the folder "eu" as input..

/usr/local/Cellar/opencv/2.4.11_1/bin/opencv_traincascade -data /train-detector/out/ -vec /train-detector/positive/vecfile.vec -bg /train-detector/negative/negative.txt -w 52 -h 13 -numPos 1347 -numNeg 3248 -featureType LBP -numStages 20
PARAMETERS:
cascadeDirName: /train-detector/out/
vecFileName: /train-detector/positive/vecfile.vec
bgFileName: /train-detector/negative/negative.txt
numPos: 1347
numNeg: 3248
numStages: 20
precalcValBufSize[Mb] : 256
precalcIdxBufSize[Mb] : 256
stageType: BOOST
featureType: LBP
sampleWidth: 52
sampleHeight: 13
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed 1347 : 1347
NEG count : acceptanceRatio 3248 : 1

Here is where not continues..

@super-cache-money
Copy link

I've got the same problem....

@sapa-denis
Copy link

Me too...

@matthill
Copy link
Contributor

That is strange. I just cloned the project and ran the commands, and it started. The only difference I can see is the OpenCV version. I'm running 2.4.9. I'm not sure if they made changes to the OpenCV training program between versions...

Maybe try removing everything in the "out" directory and run it again...

[mhill@mhill-linux train-detector]$ /storage/projects/alpr/libraries/opencv/bin/opencv_traincascade -data /tmp/train-detector/out// -vec /tmp/train-detector/positive/vecfile.vec -bg /tmp/train-detector/negative/negative.txt -w 52 -h 13 -numPos 1200 -numNeg 3248 -featureType LBP -numStages 20
PARAMETERS:
cascadeDirName: /tmp/train-detector/out//
vecFileName: /tmp/train-detector/positive/vecfile.vec
bgFileName: /tmp/train-detector/negative/negative.txt
numPos: 1200
numNeg: 3248
numStages: 20
precalcValBufSize[Mb] : 256
precalcIdxBufSize[Mb] : 256
stageType: BOOST
featureType: LBP
sampleWidth: 52
sampleHeight: 13
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed   1200 : 1200
NEG count : acceptanceRatio    3248 : 1
Precalculation time: 2
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+
|   1|        1|        1|
+----+---------+---------+
|   2|        1|        1|
+----+---------+---------+
|   3|        1|        1|
+----+---------+---------+
|   4| 0.999167| 0.603756|
+----+---------+---------+
|   5| 0.999167| 0.320197|
+----+---------+---------+
END>
Training until now has taken 0 days 0 hours 0 minutes 9 seconds.

===== TRAINING 1-stage =====
<BEGIN
POS count : consumed   1200 : 1201
NEG count : acceptanceRatio    3248 : 0.323442
Precalculation time: 2
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+
|   1|        1|        1|
+----+---------+---------+
|   2|        1|        1|
+----+---------+---------+
|   3|        1|        1|
+----+---------+---------+
|   4| 0.998333| 0.563116|
+----+---------+---------+
|   5| 0.996667| 0.349138|
+----+---------+---------+
END>
Training until now has taken 0 days 0 hours 0 minutes 19 seconds.

@olivero86
Copy link

Same problem here, have anyone found a solution? I tried matt's tip but didn't help.

/usr/local/bin/opencv_traincascade -data /Users/oli/openalpr/train-detector/out// -vec /Users/oli/openalpr/train-detector/positive/vecfile.vec -bg /Users/oli/openalpr/train-detector/negative/negative.txt -w 50 -h 11 -numPos 38 -numNeg 3248 -featureType LBP -numStages 20
PARAMETERS:
cascadeDirName: /Users/oli/openalpr/train-detector/out//
vecFileName: /Users/oli/openalpr/train-detector/positive/vecfile.vec
bgFileName: /Users/oli/openalpr/train-detector/negative/negative.txt
numPos: 38
numNeg: 3248
numStages: 20
precalcValBufSize[Mb] : 256
precalcIdxBufSize[Mb] : 256
stageType: BOOST
featureType: LBP
sampleWidth: 50
sampleHeight: 11
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed 38 : 38
NEG count : acceptanceRatio 3248 : 1

@matthill
Copy link
Contributor

Olivero, I think your issue is different. You'll need more than 38 positive samples -- that will never complete. You'll probably need at least a few hundred to get to a few stages.

@pandapo411
Copy link

I got the same error:
192:train-detector SnowAngel$ /Users/SnowAngel/Desktop/OpenALPR/opencv/StaticLibs/bin/opencv_traincascade -data /Users/SnowAngel/Desktop/OpenALPR/train-detector/out// -vec /Users/SnowAngel/Desktop/OpenALPR/train-detector/positive/vecfile.vec -bg /Users/SnowAngel/Desktop/OpenALPR/train-detector/negative/negative.txt -w 52 -h 13 -numPos 1347 -numNeg 4705 -maxFalseAlarmRate 0.45 -featureType LBP -numStages 13
PARAMETERS:
cascadeDirName: /Users/SnowAngel/Desktop/OpenALPR/train-detector/out//
vecFileName: /Users/SnowAngel/Desktop/OpenALPR/train-detector/positive/vecfile.vec
bgFileName: /Users/SnowAngel/Desktop/OpenALPR/train-detector/negative/negative.txt
numPos: 1347
numNeg: 4705
numStages: 13
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
acceptanceRatioBreakValue : -1
stageType: BOOST
featureType: LBP
sampleWidth: 52
sampleHeight: 13
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.45
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed 1347 : 1347
NEG count : acceptanceRatio 4705 : 1

@wizzed
Copy link

wizzed commented Mar 31, 2016

I've downloaded opencv 2.4.9 (windows) and used the opencv_createsamples.exe in this folder:
opencv\build\x86\vc12\bin

and it works. So I am guessing it's the version of the opencv that is causing the problem.

I can't get it to work on mac though.

@ducnmisbk
Copy link

Hi @wizzed ,
I tried to build opencv 2.4.9 by my self but stucked in "===== TRAINING 0-stage =====" too.
Could you get it to work on Mac.

I use el captain osx.

@xrnd
Copy link

xrnd commented Apr 5, 2017

Hi,
Has anybody managed to find a solution for this problem, as I am getting it too.
trying to Run command of

FULL_PATH/opencv/build/bin/opencv_traincascade -data FULL_PATH/train-detector-master/out// -vec FULL_PATH/train-detector-master/positive/vecfile.vec -bg FULL_PATH/train-detector-master/negative/negative.txt -w 50 -h 15 -numPos 1182 -numNeg 4705 -maxFalseAlarmRate 0.45 -featureType LBP -numStages 13

and got stuck after showing below

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed 1182 : 1182
NEG count : acceptanceRatio 4705 : 1

@xrnd
Copy link

xrnd commented Apr 6, 2017

@wizzed I tried the windows option too , opencv_traincascade crashes in that case

@ryantobin77
Copy link

I know this is much later, but did anyone ever resolve this issue? I am creating an object detector right now and am trying to use LBP features and am running into the same problem.

@super-cache-money
Copy link

I stopped trying to use a mac and it just worked on ubuntu.

@mribichich
Copy link

The same happened to me on mac, and I fixed it adding -precalcValBufSize 0 -precalcIdxBufSize 0 to the train command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests