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

HandPose Connections #224

Closed
shiffman opened this issue Oct 23, 2024 · 4 comments · Fixed by #226
Closed

HandPose Connections #224

shiffman opened this issue Oct 23, 2024 · 4 comments · Fixed by #226

Comments

@shiffman
Copy link
Member

Picking up on #231, I would like to propose adding getConnections() to ml5.handPose(). According to the official diagram, these are the connections. (I made this manually and the order is somewhat arbitrary. Is there an official standard?)

let connections = [
  [0, 1],
  [1, 2],
  [2, 3],
  [3, 4],
  [0, 5],
  [5, 6],
  [6, 7],
  [7, 8],
  [9, 10],
  [10, 11],
  [11, 12],
  [13, 14],
  [14, 15],
  [15, 16],
  [0, 17],
  [17, 18],
  [18, 19],
  [19, 20],
  [5, 9],
  [9, 13],
  [13, 17],
];
Screenshot 2024-10-23 at 3 35 51 PM
@ziyuan-linn
Copy link
Member

This looks great! I also think it is a good idea to add connections for handPose.

Looks like the official standards are defined in constants.ts. I think we can import it with import { MEDIAPIPE_CONNECTED_KEYPOINTS_PAIRS } from "@tensorflow-models/hand-pose-detection/dist/constants";.

Going back to the previous discussion, perhaps we can also add bodyPose.getConnections as an alias for bodyPose.getSkeleton and eventually deprecate the latter?

@ziyuan-linn ziyuan-linn linked a pull request Oct 29, 2024 that will close this issue
@ziyuan-linn
Copy link
Member

@shiffman I just made a PR to add the getConnections function.

I noticed that there is a small difference between the official connections array and the diagram. This is from the connections array:
hand skeletal connections drawn from official connections array

Which of the two connection schemes do you think we should use?

@shiffman
Copy link
Member Author

shiffman commented Oct 29, 2024

Oh interesting! I think it probably makes sense to follow the official ones! It's just strange that the official connections don't match the diagram? It's not so many keypoints that someone couldn't easily build their own list if they prefer a different visual. Maybe @MOQN has a preference?

image

(Just linking this to #227 for reference also)

@MOQN
Copy link
Member

MOQN commented Oct 30, 2024

@shiffman Thank you for looping me in!

I really don’t have any preference, but I’m leaning toward following the official version, like the one in @ziyuan-linn’s screenshot. I just searched for the actual hand skeleton, and it’s similar to the official connections, haha 😂. (I do feel the same though, about the diagram in their documentation.)

(Just a random thought: if we don't follow the official connections, we could consider connecting the points 1 and 5, instead of 0 and 5.)
had

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

Successfully merging a pull request may close this issue.

3 participants