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

How to get keypoints output .json file like original OpenPose ? #83

Open
mayank64ce opened this issue Nov 13, 2023 · 6 comments
Open

How to get keypoints output .json file like original OpenPose ? #83

mayank64ce opened this issue Nov 13, 2023 · 6 comments

Comments

@mayank64ce
Copy link

No description provided.

@patrickvonplaten
Copy link
Contributor

Sorry I don't understand the question

@mayank64ce
Copy link
Author

mayank64ce commented Nov 14, 2023

I meant the output of the original OpenPose is a json file with 2d keypoints which look something like this:

{
  "version": 1.3,
  "people": [
    {
      "person_id": [
        -1
      ],
      "pose_keypoints_2d": [
        535.734,
        246.827,
        0.855832,
        ....
      ],
      "face_keypoints_2d": [
        496.62,
        230.471,
        0.699601,
        ...
      ],
      "hand_left_keypoints_2d": [
        751.966,
        512.104,
        0.542437,
        ...
      ],
      "hand_right_keypoints_2d": [
        266.106,
        510.039,
        0.540713,
        ....
      ],
      "pose_keypoints_3d": [],
      "face_keypoints_3d": [],
      "hand_left_keypoints_3d": [],
      "hand_right_keypoints_3d": []
    }
  ]
} 

Can I get these values, not just the output plot from controlnet_aux ?

@pdoane
Copy link
Collaborator

pdoane commented Nov 15, 2023

This functionality is in the A1111 implementation, e.g. see https://github.com/Mikubill/sd-webui-controlnet/blob/main/annotator/openpose/__init__.py#L122

@mayank64ce
Copy link
Author

mayank64ce commented Nov 15, 2023

So if I pass the poses from https://github.com/patrickvonplaten/controlnet_aux/blob/master/src/controlnet_aux/open_pose/__init__.py#L220

to that function, I should be able to get the json right ?

UPDATE: I tried it and it kinda works. However, the original OpenPose gives 75 values under the pose_keypoints_2d key whereas controlnet_aux is giving 54 values. Is it detecting less points ?

UPDATE 2: Seems like I need BODY_25 but I am not sure how to use it with controlnet.

@pdoane
Copy link
Collaborator

pdoane commented Nov 17, 2023

There's a good chance that the openpose implementations have diverged. I last updated all of them on 5/27 so it's worth a pass to review.

@mayank64ce
Copy link
Author

yeah latest openpose has 7 additinal joints. The pelvis + 2 toes and ankle for both feet. Anyways those didn't matter to me. I approximated the position of pelvis with hip joints and mapped the toes and ankle to feet.

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

3 participants