akanazawa/hmr

How to map joints 3d back to original image?

128ve900 opened this issue · 1 comments

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.

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:

hmr/demo.py

Line 41 in bce0ef9

def visualize(img, proc_param, joints, verts, cam):

kp_original = (joints + proc_param['start_pt'] - margin) * undo_scale

Best,

Angjoo