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.88k stars 1.33k forks source link

about tensor input #330

Open Panghema opened 1 year ago

Panghema commented 1 year ago

hey, thanks for your share. when using the method 'get_landmarks_from_image', I input a tensor whose size is (1, 3, 128, 128) to image_or_path. then it will call method 'get_image' from face_alignment.utils. first, it transforms tensor into numpy, then steps into 'elif image.ndim == 4: \n\t image = image[..., :3]. this step changes the size of numpy from (1, 3, 128, 128) into (1, 3, 128, 3). actually, final size will not be used correctly in the method 'detect_from_image' in face_alignment.detection.sfd.sfd_detector.SFDDecetector. if it's a bug here, or it because of my wrong usage. hope for your reply!

1adrianb commented 1 year ago

The expected image shape is (H,W,3). A basic batching is implemented using get_landmarks_from_batch().