facebookresearch / KeypointNeRF

KeypointNeRF Generalizing Image-based Volumetric Avatars using Relative Spatial Encoding of Keypoints
Other
373 stars 28 forks source link

How to extract 3d keypoints for other human dataset? #13

Open Talegqz opened 1 year ago

Talegqz commented 1 year ago

If I have SMPL vertices, how to precalculate 3D joints?

Talegqz commented 1 year ago

Using following code, I cannot get same 3d joints as you provided.

import smplx
import numpy as np
import torch
model = smplx.SMPL(model_path='SMPL_NEUTRAL.pkl')

joints_3d = np.load('CoreView_394/joints3d/0.npy')

parameters = np.load('CoreView_394/params/0.npy',allow_pickle=True).item()

out = model(torch.from_numpy(parameters['shapes']).float(),torch.from_numpy(parameters['poses'])[:,3:].float(),torch.from_numpy(parameters['Rh']).float())

out_joints = out.joints.detach().cpu().numpy()[:,0:24]+parameters ['Th']