akanazawa / hmr

Project page for End-to-end Recovery of Human Shape and Pose
Other
1.55k stars 392 forks source link

How to map joints 3d back to original image? #130

Closed 128ve900 closed 4 years ago

128ve900 commented 4 years ago

Hello! Thank you very much for sharing.

I got joints3d by the code below: joints_crop, verts_crop, cam_crop, joints3d_crop, theta = model.predict(input_img, get_theta=True)

How can I map joints3d back to the original image? I drew the x, y coordinates of joints3d on the original image, and got the following results. f20200406004256

Looking forward to your reply.

akanazawa commented 4 years ago

You need to convert some coordinate systems as the prediction happens in the normalized bbox coord space. Please see the visualization code which does this to the 2D joints and the mesh -- The 2D joints are just the projections of this 3D joints so you can just take that output: https://github.com/akanazawa/hmr/blob/bce0ef9b90bd36871d2aff8688b2682170cd365a/demo.py#L41 https://github.com/akanazawa/hmr/blob/bce0ef9b90bd36871d2aff8688b2682170cd365a/src/util/renderer.py#L260

Best,

Angjoo