serengil / retinaface

RetinaFace: Deep Face Detection Library for Python
https://www.youtube.com/watch?v=Wm1DucuQk70&list=PLsS_1RYmYQQFdWqxQggXHynP1rqaYXv_E&index=3
MIT License
1.23k stars 154 forks source link

Performance #25

Closed uutzinger closed 2 years ago

uutzinger commented 2 years ago

I assume once a face detector model is trained its difficult to adapt it to a different input tensor size.

Retinaface image scales input images to 1024...1980 size which likely is useful to detect any face in a large image. However Retianface is also accurate when the face is obstructed by facemask. Using your deepface repository and measuring performance for all the provided face detectors I get something like this:

Retinaface: 172-229ms works with glasses, obstruction and facemask OpenCV: 40-50ms does not work with glasses or obstructions SSD: 19-30ms works with glasses and obstruction, but not with facemask MTCNN: 945-3125ms works with glasses and obstruction, but not with facemask DLIB: 346-350ms works with glasses, but not with obstruction or facemask

As you can see retinaface is not the fastest but most reliable detector, in your series of implementations. If there is option to use smaller input tensor or a different tensor platform, like suggested by other user (TensorRT), it would be worth the effort for real-time applications.

serengil commented 2 years ago

Thank you for this research results. I already know retinaface is the most robust one but it is also the slowest but your work also shows its performance with glass, mask and obstruction.