torch-opencv-demos icon indicating copy to clipboard operation
torch-opencv-demos copied to clipboard

Unknown predict face_recognition

Open bbhushan-ds opened this issue 8 years ago • 6 comments

Hi

We have predict functionality in face_recognition which somehow predict the person. But do we have unknown person functionality which person is not available in training?

Thanks BB

bbhushan-ds avatar Aug 19 '16 08:08 bbhushan-ds

You can insert an extra "person" into the gallery called "Unknown" and assign this label to all the unknown people. Or, if you want to experiment with the code, you may try other classifiers besides SVM.

shrubb avatar Aug 19 '16 13:08 shrubb

Thanks for reply.

Logically I would not have pic for unknown persons. Or is it beneficial to have unknown person label?

Second, could you please give me some idea how I can try other classifier besides svm? It would be great if you help me for this. I would appreciate.

Thanks BB

bbhushan-ds avatar Aug 20 '16 16:08 bbhushan-ds

Hi,

Do you have any idea how we can calculate the confidence in SVM. which will allow me to predict the unknown person. Thanks

bbhushan-ds avatar Aug 31 '16 13:08 bbhushan-ds

Sorry for delay.You may get the wrong thing with SVM's "confidences" (which are not really a natural thing for it). I suggest 2 alternatives:* Read this research on open set learning. For example, the 2011 article proposes two SVM modifications for that.* Try nearest neighbors instead of SVM. Make sure you have a decent number of samples, maybe even more than #gallerySize. When predicting, get the distance to the nearest neighbor. If it's greater than X, then yield "unknown". Choose X empirically.

shrubb avatar Aug 31 '16 16:08 shrubb

is there any simple way to find the nearest neighbors of a person. And how to get the distance while predicting. I am asking any working example in lua language.

Thanks Bharat Bhushan

bbhushan-ds avatar Sep 08 '16 10:09 bbhushan-ds

There's kNN implementation in OpenCV: http://docs.opencv.org/trunk/dd/de1/classcv_1_1ml_1_1KNearest.html

shrubb avatar Sep 09 '16 08:09 shrubb