openalpr / train-detector

Input files and scripts necessary to train the license plate detector.
GNU Affero General Public License v3.0
125 stars 166 forks source link

TRAINING 0-stage not moving forward #8

Open morex87 opened 9 years ago

morex87 commented 9 years ago

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 commented 9 years ago

I've got the same problem....

sapa-denis commented 9 years ago

Me too...

matthill commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 7 years ago

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 commented 7 years ago

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

ryantobin77 commented 7 years ago

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 commented 7 years ago

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

mribichich commented 6 years ago

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