Ask Your Question

Revision history [back]

As already mentioned in the code you can use model->predict(testSample, predictedLabel, confidence); to get the predictedLabel and confidence, the confidence variable will give you the estimate of how accurate the prediction is. the lesser the value to more accurate the prediction is.

So you can use it like this way

if(confidence<50){
    // put the predictedLebel as a detected face
}
else{
    // put the Unknown as a detected face
}

Now you can play with this value 50 to work best for you.

here is a series of article in python if you are interested for face recognition for known and unknown faces

As already mentioned in the code you can use model->predict(testSample, predictedLabel, confidence); to get the predictedLabel and confidence, the confidence variable will give you the estimate of how accurate the prediction is. the lesser the value to more accurate the prediction is.

So you can use it like this way

if(confidence<50){
    // put the predictedLebel as a detected face
}
else{
    // put the Unknown as a detected face
}

Now you can play with this value 50 to work best for you.

hereHere is a series of article articles in python if you are interested for face recognition for known and unknown faces