1adrianb / face-alignment

:fire: 2D and 3D Face alignment library build using pytorch
https://www.adrianbulat.com
BSD 3-Clause "New" or "Revised" License
6.94k stars 1.33k forks source link

Expected running time? #175

Closed antithing closed 4 years ago

antithing commented 4 years ago

Hi, and thank you for making this code available. i am running it from source on a GTX 1080, and when I time the function:

preds = fa.get_landmarks(input_img)[-1]

It takes around 300 ms to calculate landmarks. (after the first run, the GPU is warmed up)

Is this expected? Is it possible to run this faster? i am hoping for real time use, so <30 ms.

Thanks!

1adrianb commented 4 years ago

Hi, since the system contains both a face detector and a face alignment network, the first component will be dependent on the image resolution. To speed-up things, depending on the size of your facial images you could downscale the input image. The 4 stack model provided, minus the detection model should be able to achieve around 20fps on a 1080Ti. While there are multiple paths for speeding this up, some discussed in other github issues, the first mentioned is the easiest probably to do.