hrastnik / face_detect_n_track

Fast and robust face detection and tracking
MIT License
504 stars 159 forks source link

Could it do multiple faces and could it recognise them ? #4

Open atv2016 opened 8 years ago

atv2016 commented 8 years ago

How hard would it be to implement such a thing?

pgigioli commented 8 years ago

I have the same question. I'm really interested in implementing your algorithm but I am also curious how this could be used to handle multiple faces?

hrastnik commented 8 years ago

It is possible to track multiple faces but only if you know the exact number of faces you're expecting to get in the frame. I made some tweaks to this algorithm to allow multiple faces tracking in my other project https://github.com/mc-jesus/FaceSwap

You can use it if it suits your needs.

pgigioli commented 8 years ago

I successfully implemented your algorithm on my robot using ROS. Good work. For the multiple faces issue, I'm thinking that a possible solution might be to "flash" the cascade classifier every, say, 10 frames on the whole video feed to capture new faces and then return to your algorithm that tracks the faces in the smaller ROIs. This will allow you to track n number of faces while keeping the algorithm quick. What do you think?

hrastnik commented 8 years ago

It can be done... I might get around implementing this actually.

atv2016 commented 8 years ago

Hey Matt, Does your application really track faces or does it redetect with each frame. I had this idea to mitigate false positives with face recognition but I'd need to really track faces for that to work. Is face swap better then your other face detect program?

Maybe you would be willing to work with me on that?

Kind regards, Alef

Sent from my iPhone

On 27 Apr 2016, at 07:12, Matt Hammond notifications@github.com wrote:

It is possible to track multiple faces but only if you know the exact number of faces you're expecting to get in the frame. I made some tweaks to this algorithm to allow multiple faces tracking in my other project https://github.com/mc-jesus/FaceSwap

You can use it if it suits your needs.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

hrastnik commented 8 years ago

The algorithm details are explained in the readme. It basically detects the face in the region where it was detected in the previous frame, and if that fails it falls back to template matching. Face swap uses the same algo but it's modded to expect 2 faces before it starts tracking.