Daniil-Osokin / lightweight-human-pose-estimation-3d-demo.pytorch

Real-time 3D multi-person pose estimation demo in PyTorch. OpenVINO backend can be used for fast inference on CPU.
Apache License 2.0
660 stars 138 forks source link

Interpreting 2d coordinate output #64

Closed riboyuan99 closed 3 years ago

riboyuan99 commented 3 years ago

I am able to get 2d coordinate by following code: poses_3d, poses_2d = parse_poses(inference_result, input_scale, stride, fx, is_video) and the output looks like this:

[ 9.87000000e+02  8.40000000e+01  7.44423568e-01 -8.00000000e+00
  -8.00000000e+00 -1.00000000e+00 -1.00000000e+00 -1.00000000e+00
  -1.00000000e+00  9.95000000e+02  8.40000000e+01  7.20652282e-01
   1.02900000e+03  1.43000000e+02  4.71996784e-01  1.02900000e+03
   1.85000000e+02  4.42449659e-01  9.95000000e+02  2.10000000e+02
   6.77076042e-01  9.61000000e+02  2.86000000e+02  6.98154628e-01
   9.53000000e+02  3.54000000e+02  5.87647200e-01  9.53000000e+02
   8.40000000e+01  6.99335754e-01  9.28000000e+02  1.43000000e+02
   3.37824076e-01  9.28000000e+02  1.51000000e+02  1.61912560e-01
   9.61000000e+02  2.10000000e+02  6.83217466e-01  9.87000000e+02
   2.86000000e+02  6.84145570e-01  9.95000000e+02  3.45000000e+02
   5.94412923e-01 -8.00000000e+00 -8.00000000e+00 -1.00000000e+00
  -8.00000000e+00 -8.00000000e+00 -1.00000000e+00 -8.00000000e+00
  -8.00000000e+00 -1.00000000e+00 -8.00000000e+00 -8.00000000e+00
  -1.00000000e+00  1.42583218e+01]

How do I know which body part it is referring to?

Any advice would be appreciated.

Daniil-Osokin commented 3 years ago

Hi! You can check draw_poses, which parses and draws 2D poses coordinates.

riboyuan99 commented 3 years ago

Thanks for your helpful hint. I have read the code but got stuck on one thing. We only have 18 body parts:

Screen Shot 2021-03-21 at 5 05 12 PM

But we have 19 kpt_id:

for kpt_id in range(pose.shape[1])

What is the missing one?

Any hint would be appreciated

Daniil-Osokin commented 3 years ago

Nothing is missed. 2D network detects 18 keypoints you have found above. The order of 2D keypoints is aligned to match the 3D network output. 2 is reserved value for pelvis in 3D network. Now it is not predicted, it was left for the future.

riboyuan99 commented 3 years ago

Thank you very much!

adammpolak commented 2 years ago

@Daniil-Osokin sorry so there is no predicted 3D pelvis in this model?

Daniil-Osokin commented 2 years ago

Right.

adammpolak commented 2 years ago

@Daniil-Osokin but parse poses emits a pelvis in index 2? Is that not an accurate calculation or something?

Daniil-Osokin commented 2 years ago

It always has "-1" as coordinates values. It is left for the legacy reasons.