I have built a face recognition model based on Pyimagesearch Tutorial

It works great on images but the issue I am facing is with videos.

I am recognizing the faces frame by frame(5fps). It gives me people present in the particular video frame.

But the same person is identifed with different names in different frames.

How can I restrict it to identify same name with throughout the video?

Sometimes it also recognized two different people with same name. Eg. Sam and Dean are present in the frame but it identifies both as sam.


1 Answer 1


The pyimagesearch face recognition implementation used knn classifier to recognise the faces. I have worked with both svm and knn classifiers, from my experience you can do a couple of thinks to improve the face recognition performance. 1. use svm with higher C value (1 to 10) over knn classifier. 2. Maintain relatively equal number of images in all classes

  • $\begingroup$ Thanks for the reply but accuracy is not my concern here. I am looking to track the person in video. Right now I am performing Face Detection on each frame and I would like to do it once and track the sam person throughout video $\endgroup$
    – Sociopath
    Sep 10, 2019 at 4:56
  • 1
    $\begingroup$ In that situation you need a tracker. The order would be 1. Face detection on first Frame 2. Initiating a tracker to track that face in the future frames. $\endgroup$ Sep 11, 2019 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.