1adrianb / face-alignment

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

how to get face landmarks from a batch? #312

Open zenoxux opened 2 years ago

zenoxux commented 2 years ago

could anyone tell me how to get face landmarks from a batch? the api 'get_landmarks_from_batch' seems not to work, the code shows that it still get landmarks from image one by one. could anyone help me? thanks in advance.

Panghema commented 11 months ago

according to face_alignment.detection.sfd.detect.py, we can see they did some treate like normalization img_batch = img_batch - torch.tensor([104.0, 117.0, 123.0], device=device).view(1, 3, 1, 1) attention, they minus [104, 117, 123], but our tensor must be normalized between [-1, 1]. i guess the range of tensors they input is [0, 255], so you can restore the value range of your tensors to 0 to 255