andrefdre / SAVI_Face_Recognition

MIT License
1 stars 0 forks source link

Faces recognition #7

Closed andrefdre closed 1 year ago

andrefdre commented 1 year ago

I found this link that explains very well how the recognition works and some methods we can use : https://towardsdatascience.com/real-time-face-recognition-an-end-to-end-project-b738bb0f7348

After some reading I found that the method Local binary patterns histograms (LBPH) Face Recognizer is the best option since it's not affected by light variation.

andrefdre commented 1 year ago

I had a problem when creating the face recognition model with the command cv2.face.LBPHFaceRecognizer_create() which gave the error face is not a module of cv2. And i solve this problem running the next code in the console pip install --force-reinstall opencv-contrib-python==4.1.2.30

andrefdre commented 1 year ago

The basic implementation of face recognition it's working. One of it's major problems is tgat it's using detections to have images which aren't as stable as tracking. For now there is also no association of the name with the detection since it only makes sense with the tracking. More work is needed after tracking is implemented.

andrefdre commented 1 year ago

While I was thinking about recognition I had a question, right now I'm recognizing the image every time but is it better if we just recognize once and then associate to the tracker store the name in the tracker and only perform the recognition if the tracker has no name?

LimitlessGrey commented 1 year ago

So, no detections performed on already recognized people? I don't believe that is possible. I do believe tho that once detected that bbox can only be tracked. This way we could make the program create a new detection once every {x} seconds. This would indeed improve the fluidity since it wouldn't need doing detections every single frame. I haven't yet found a way for it to track without it being multiple and serial detections, and will look further into it.

andrefdre commented 1 year ago

I wasn't saying no trackings on already recognized people. What I meant was first associate the recognized person to the tracking so next cycle I woun't recognize people in that tracking. This would solve the people names changing halfway. My only feer is for exmple I'm tracking 0 if I leave next person that enter will be tracking 0 so will be the person Andre which would be wrong.

LimitlessGrey commented 1 year ago

I dont think it resets the DB until we close the program so that might be a non issue :p I understood but I dont think that will happen tho

andrefdre commented 1 year ago

The problem wouldn't be the database would be that new person would be tracker 0 what we could do is that when people leaves is deactivate the tracker and even if the person comes back keep it offline and create a new tracker and a new recognition.

LimitlessGrey commented 1 year ago

Is this an hypothesis or is it actually happening like this?

andrefdre commented 1 year ago

I haven't tried it yet since it is recognizing every cycle. It is what I suppose it will happen.

LimitlessGrey commented 1 year ago

I suggest we think about it when or if it happens.

andrefdre commented 1 year ago

Okay, but do you suggest trying to associate the recognition to the tracking and then perform recognition only on new tracker?

LimitlessGrey commented 1 year ago

Not on a new tracker but on a new detection.