Ask Your Question

Revision history [back]

opencv_traincascade stuck on precalculation when running LBP mode

My cascade training works when using Haar but not LBP. The problem seems to occur during the precalcuation phase. For example, when running:

opencv_traincascade -data classifier -vec positive_samples.vec -featureType LBP -bg negative_image_list.txt -precalcValBufSize 1024 -precalcIdxBufSize 1024 -numPos 315 -numNeg 458 -nstages 20 -w 40 -h 40

The output I receive is:

PARAMETERS:
cascadeDirName: classifier
vecFileName: positive_samples.vec
bgFileName: negative_image_list.txt
numPos: 315
numNeg: 458
numStages: 20
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
stageType: BOOST
featureType: LBP
sampleWidth: 40
sampleHeight: 40
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed   315 : 315
NEG count : acceptanceRatio    458 : 1

And it stalls at this point without moving forward (even when waiting for 30+ minutes). If I run this same command using HAAR instead of LBP, the recalculation finishes within 10 seconds or so. I've tried fiddling with the minHitRate and whatnot, but with no other results. When other people's opencv_traincascade stalls, it seems to occur before NEG count : acceptanceRatio is displayed, which leads me to believe I'm having a different problem. Can anyone explain why I might be hitting this wall?

opencv_traincascade stuck on precalculation when running LBP mode

My cascade training works when using Haar but not LBP. The problem seems to occur during the precalcuation phase. For example, when running:

opencv_traincascade -data classifier -vec positive_samples.vec -featureType LBP -bg negative_image_list.txt -precalcValBufSize 1024 -precalcIdxBufSize 1024 -numPos 315 -numNeg 458 -nstages 20 -w 40 -h 40

The output I receive is:

PARAMETERS:
cascadeDirName: classifier
vecFileName: positive_samples.vec
bgFileName: negative_image_list.txt
numPos: 315
numNeg: 458
numStages: 20
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
stageType: BOOST
featureType: LBP
sampleWidth: 40
sampleHeight: 40
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed   315 : 315
NEG count : acceptanceRatio    458 : 1

And it stalls at this point without moving forward (even when waiting for 30+ minutes). If I run this same command using HAAR instead of LBP, the recalculation finishes within 10 seconds or so. I've tried fiddling with the minHitRate and whatnot, but with no other results. When other people's opencv_traincascade stalls, it seems to occur before NEG count : acceptanceRatio is displayed, which leads me to believe I'm having a different problem. Can anyone explain why I might be hitting this wall?

UPDATE

I've found that the program is definitely trying in some way, as it shows up in my Activity Monitor as consuming a huge amount of CPU.

Another user seems to have had this problem a year ago on StackOverflow and tried many things, but they seem to have had no success. Their plight can be found here.

opencv_traincascade stuck on precalculation when running LBP mode

My cascade training works when using Haar but not LBP. The problem seems to occur during the precalcuation phase. For example, when running:

opencv_traincascade -data classifier -vec positive_samples.vec -featureType LBP -bg negative_image_list.txt -precalcValBufSize 1024 -precalcIdxBufSize 1024 -numPos 315 -numNeg 458 -nstages 20 -w 40 -h 40

The output I receive is:

PARAMETERS:
cascadeDirName: classifier
vecFileName: positive_samples.vec
bgFileName: negative_image_list.txt
numPos: 315
numNeg: 458
numStages: 20
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
stageType: BOOST
featureType: LBP
sampleWidth: 40
sampleHeight: 40
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed   315 : 315
NEG count : acceptanceRatio    458 : 1

And it stalls at this point without moving forward (even when waiting for 30+ minutes). If I run this same command using HAAR instead of LBP, the recalculation finishes within 10 seconds or so. I've tried fiddling with the minHitRate and whatnot, but with no other results. When other people's opencv_traincascade stalls, it seems to occur before NEG count : acceptanceRatio is displayed, which leads me to believe I'm having a different problem. Can anyone explain why I might be hitting this wall?

UPDATE

I've found that the program is definitely trying in some way, as it shows up in my Activity Monitor as consuming a huge amount of CPU.

Another user seems to have had this problem a year ago on StackOverflow and tried many things, but they seem to have had no success. Their plight can be found here.. It may be worth noting that we are both on OS X.

opencv_traincascade stuck on precalculation when running LBP mode

My cascade training works when using Haar but not LBP. The problem seems to occur during the precalcuation phase. For example, when running:

opencv_traincascade -data classifier -vec positive_samples.vec -featureType LBP -bg negative_image_list.txt -precalcValBufSize 1024 -precalcIdxBufSize 1024 -numPos 315 -numNeg 458 -nstages 20 -w 40 -h 40

The output I receive is:

PARAMETERS:
cascadeDirName: classifier
vecFileName: positive_samples.vec
bgFileName: negative_image_list.txt
numPos: 315
numNeg: 458
numStages: 20
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
stageType: BOOST
featureType: LBP
sampleWidth: 40
sampleHeight: 40
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed   315 : 315
NEG count : acceptanceRatio    458 : 1

And it stalls at this point without moving forward (even when waiting for 30+ minutes). If I run this same command using HAAR instead of LBP, the recalculation finishes within 10 seconds or so. I've tried fiddling with the minHitRate and whatnot, but with no other results. When other people's opencv_traincascade stalls, it seems to occur before NEG count : acceptanceRatio is displayed, which leads me to believe I'm having a different problem. Can anyone explain why I might be hitting this wall?

UPDATE

I've found that the program is definitely trying in some way, as it shows up in my Activity Monitor as consuming a huge amount of CPU.

Another user seems to have had this problem a year ago on StackOverflow and tried many things, but they seem to have had no success. Their plight can be found here. It may be worth noting that we are both on OS X.

UPDATE 2

Trying the exact same dataset and command on an Ubuntu machine has the script run correctly. So it seems to be related to the OS X installation of OpenCV in some way.