vitoralbiero / img2pose

The official PyTorch implementation of img2pose: Face Alignment and Detection via 6DoF, Face Pose Estimation - CVPR 2021
Other
588 stars 109 forks source link

how to optimize and speed up the alignment code? #34

Closed Jar7 closed 3 years ago

Jar7 commented 3 years ago

Hello, thank your for your work. I read the alignment code and found there is a pytorch version alignment function. Can it be used for inference? Do you think it is possible to align faces by batch or any other ways to speed up the alignment process? like run in gpu? Thank you!

vitoralbiero commented 3 years ago

Hello @Jar7, Thanks for your interest in our work!

Right now on the run_alignment.py script, inference is running one image at a time, but you could easily modify it to run on a batch of images and then perform alignment on each one. I haven't measured the time necessary for the alignment part of the script, but I believe it to be negligible compared to the inference time. If you decide to make improvements, PRs are welcome!

Hope this helps.