add the possibility to add traincascade accuracy
This commit is contained in:
@@ -136,7 +136,8 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
|
||||
const CvCascadeParams& _cascadeParams,
|
||||
const CvFeatureParams& _featureParams,
|
||||
const CvCascadeBoostParams& _stageParams,
|
||||
bool baseFormatSave )
|
||||
bool baseFormatSave,
|
||||
double acceptanceRatioBreakValue)
|
||||
{
|
||||
// Start recording clock ticks for training time output
|
||||
const clock_t begin_time = clock();
|
||||
@@ -186,6 +187,7 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
|
||||
cout << "numStages: " << numStages << endl;
|
||||
cout << "precalcValBufSize[Mb] : " << _precalcValBufSize << endl;
|
||||
cout << "precalcIdxBufSize[Mb] : " << _precalcIdxBufSize << endl;
|
||||
cout << "acceptanceRatioBreakValue : " << acceptanceRatioBreakValue << endl;
|
||||
cascadeParams.printAttrs();
|
||||
stageParams->printAttrs();
|
||||
featureParams->printAttrs();
|
||||
@@ -208,15 +210,20 @@ bool CvCascadeClassifier::train( const string _cascadeDirName,
|
||||
if ( !updateTrainingSet( requiredLeafFARate, tempLeafFARate ) )
|
||||
{
|
||||
cout << "Train dataset for temp stage can not be filled. "
|
||||
"Branch training terminated." << endl;
|
||||
"Branch training terminated." << endl;
|
||||
break;
|
||||
}
|
||||
if( tempLeafFARate <= requiredLeafFARate )
|
||||
{
|
||||
cout << "Required leaf false alarm rate achieved. "
|
||||
"Branch training terminated." << endl;
|
||||
"Branch training terminated." << endl;
|
||||
break;
|
||||
}
|
||||
if( (tempLeafFARate <= acceptanceRatioBreakValue) && (acceptanceRatioBreakValue >= 0) ){
|
||||
cout << "The required acceptanceRatio for the model has been reached to avoid overfitting of trainingdata. "
|
||||
"Branch training terminated." << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
CvCascadeBoost* tempStage = new CvCascadeBoost;
|
||||
bool isStageTrained = tempStage->train( (CvFeatureEvaluator*)featureEvaluator,
|
||||
|
||||
Reference in New Issue
Block a user