Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NormalizedPointofInterest2D are actually not normalized (?) #4

Open
Luca-Pozzi opened this issue Jul 17, 2023 · 0 comments
Open

NormalizedPointofInterest2D are actually not normalized (?) #4

Luca-Pozzi opened this issue Jul 17, 2023 · 0 comments

Comments

@Luca-Pozzi
Copy link

Hi!

I am currently using this awesome package to try to implement a video-based diarization of speakers. To do so, I accessed the facial landmarks. Surprisingly, I got them in the typical range of image pixels, though they are represented as a list of NormalizedPointOfInterest2D.

Indeed, inspecting the FaceDetector in the detect script (lines 570 to 691), it looks like facial landmarks are published as non-normalized integers. Below is a subset of those lines, for the sake of readability.

def make_facial_landmarks_msg(self, detection, img_height, img_width):

        # PoI = Points of Interest
        poi = [
            NormalizedPointOfInterest2D(
                int(detection.landmark[ros4hri_to_mediapipe[idx]].x * img_width),
                int(detection.landmark[ros4hri_to_mediapipe[idx]].y * img_height),
                1,
            )
            for idx in range(68)
        ]

and below are the values that I get when looking into a /humans/faces/<face_id>/landmarks, again cropped for conciseness

header: 
  seq: 15
  stamp: 
    secs: 0
    nsecs:         0
  frame_id: ''
landmarks: 
  - 
    x: 274.0
    y: 332.0
    c: 1.0
  - 
    x: 274.0
    y: 345.0
    c: 1.0
  - 
    x: 276.0
    y: 359.0
    c: 1.0
  - 
    x: 278.0
    y: 373.0
    c: 1.0
  - 
    x: 281.0
    y: 386.0
    c: 1.0

    ...

Is this the intended behavior? Or should the landmarks be published in the [0.0 1.0] range?

Thank you in advance!
I will be happy to contribute with a PR on this if you confirm me that this has to change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant