1adrianb / 1adrianb/face-alignment

about tensor input

Open
#330 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7.5k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

No contributing guide indexed for this repository

Research direction

Look at the `get_landmarks_from_image` method and the `get_image` function in `face_alignment/utils.py`. The issue describes a tensor shape transformation from (1, 3, 128, 128) to (1, 3, 128, 3). Examine the indexing logic in the `elif image.ndim == 4:` block. Then trace the call to `detect_from_image` in `face_alignment/detection/sfd/sfd_detector.py` to see how the resulting shape is used. Run a test with a dummy tensor to reproduce the shape mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
computer-vision
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.