serengil / deepface

A Lightweight Face Recognition and Facial Attribute Analysis (Age, Gender, Emotion and Race) Library for Python
https://www.youtube.com/watch?v=WnUVYQP4h44&list=PLsS_1RYmYQQFdWqxQggXHynP1rqaYXv_E&index=1
MIT License
14.43k stars 2.21k forks source link

Implementation of Darknet's Yolo in Deepface Detectors #682

Closed Zaeem20 closed 1 year ago

Zaeem20 commented 1 year ago

Hey serengil;

I am pretty much satisfied with your work, as I am using your library in my projects, while doing some research I got this, it seems that yoloface algorithm is much faster and more accurate than MTCNN and UltraLight, can you implement it in DeepFace too...

image

serengil commented 1 year ago

found this tensorflow implementation - https://github.com/sthanhng/yoloface

also its pip package is available depending on opencv - https://pypi.org/project/yoloface/

will work to implement this dependency when i have time

Zaeem20 commented 1 year ago

Ok is there any option currently to set detector_backend as yoloface or do I just want to set my custom detector in DeepFace.verify() if yes then how do I do that?

Zaeem20 commented 1 year ago

Waiting for answer @serengil

serengil commented 1 year ago

No you cannot use that backend now

Zaeem20 commented 1 year ago

Any ETA for Next Release as you said for this yoloface implementation, By the way, I also implemented yoloface in detectors in my forked repo, but there is a problem with landmarks or facial features you can say, for alignment. I am unable to do that, but it may help you. Would you like me to make a pull request for it??? @serengil

serengil commented 1 year ago

Do not wait it to be implemented soon.

PRs are welcome but I cannot merge it if it is not working with alignment.

Vincent-Stragier commented 1 year ago

Hi @serengil,

found this tensorflow implementation - https://github.com/sthanhng/yoloface

also its pip package is available depending on opencv - https://pypi.org/project/yoloface/

will work to implement this dependency when i have time

I think it's a bad idea to use this specific library, because, it seems to be quite old (it's supposed to run on Python 3.6), and you have to manually download the weights…

I've seen other potential candidates, but I did not try them (https://github.com/derronqi/yolov7-face, https://github.com/TexasInstruments/edgeai-yolov5/tree/yolo-pose).

Another approach could be to extract the bodies using the classic YOLO models and then use a second technic to detect the faces. That's an advice one of my colleague gave me this week. It's interesting since you do not need to retrain YOLO, and it should be pretty fast too.

Zaeem20 commented 1 year ago

i got this github repo based on yolo5 face detection with landmarks: Here

i think it will be quite useful if we use that for this as we don't need to build it from scratch @serengil

Vincent-Stragier commented 1 year ago

Hi @Zaeem20,

This is interesting, but it looks like it's not better than Retinaface (and the paper backing the repo you linked seems to contain mistakes regarding the performances compared to SoA that have not yet been addressed by the authors). Still, if there is a speed improvement, it can be useful.

Note that you can extract the faces with whatever fits your needs and then skip the face detection feature (detector_backend = "skip") of some of this module functions and methods.

Zaeem20 commented 1 year ago

Oh, thanks for your response, you cleared all of my doubts @serengil, yup I will do detector_backend = 'skip' as I have another detection algorithm for face extraction, also think about yolo5 or yolo7 too as it is faster in terms of speed also accurate too...

Thanking You; Zaeem Durani