roboticslab-uc3m / vision

Vision processing
https://robots.uc3m.es/vision/
11 stars 7 forks source link

Introducing a landmark-based face detector #108

Closed PeterBowman closed 2 years ago

PeterBowman commented 2 years ago

Our new member @cllamasmar (Carlos) is working on a face detector based on dlib and the histogram of oriented gradients algorithm. This Python example is probably close to the working implementation he showed me today. I have suggested that a new IDetector C++ component can be derived from it and reused even in Python apps. Proposed YARP device name: HogFaceDetector.

PS It gets funny once you know what a "hog" is (no, I didn't check it this morning). I hope we can stick to this name, @jgvictores.

jgvictores commented 2 years ago

Afaik, a detector based on HOG features should/could be more generic (similar to how Haar which we use for faces, but depends on a .xml cascade/config file).

❤️ HogFaceDetector, but maybe HogDetector would be better?

PeterBowman commented 2 years ago

That would be ideal. I think Carlos tried the get_frontal_face_detector function as all he needs is detection of faces and a certain number of landmarks on them (see example). There is a more generic object_detector class we would need to investigate further. For now, I'd go on with faces only and upgrade to generic objects when we learn more about this library. Furthermore, there are CNN utilities specifically related to face detection (check the cnn_face_detection_model_v1 function); not sure if only available to Python code, though.

PeterBowman commented 2 years ago

ASWJ, we would rather explore a generic HOG implementation with OpenCV. It is a better option than dlib from our point of view since there is no need to configure another dependency. Also, we have no experience with dlib.

tl;dr: looking forward to detecting hogs in OpenCV, but no plans to do so in the short-mid-long term, therefore closing as invalid/a-bit-too-rushed-my-bad. (@cllamasmar please re-open if you would like to work on this!)

PeterBowman commented 2 years ago

looking forward to detecting hogs in OpenCV, but no plans to do so in the short-mid-long term

We are currently revisiting this.

PeterBowman commented 2 years ago

Important to note: dlib must be compiled and installed from sources (https://github.com/davisking/dlib) instead of via apt (libdlib-dev package) due to a bug related to dlib::cv_image which prevents from compiling dependent projects.

cllamasmar commented 2 years ago

https://medium.com/codex/facial-landmark-detection-algorithms-5b2d2a12adaf https://github.com/opencv/opencv_contrib/tree/b2904b94414e885a595ec0c56fa70da5a3fe8472/modules/face/src

cllamasmar commented 2 years ago

Captura de pantalla de 2022-06-02 12-27-38