MCPcopy Create free account
hub / github.com/MoyGcc/vid2avatar / transform_smpl

Function transform_smpl

preprocessing/preprocessing_utils.py:196–206  ·  view source on GitHub ↗
(curr_extrinsic, target_extrinsic, smpl_pose, smpl_trans, T_hip)

Source from the content-addressed store, hash-verified

194
195# transform SMPL such that the target camera extrinsic will be met
196def transform_smpl(curr_extrinsic, target_extrinsic, smpl_pose, smpl_trans, T_hip):
197
198 R_root = cv2.Rodrigues(smpl_pose[:3])[0]
199 transf_global_ori = np.linalg.inv(target_extrinsic[:3,:3]) @ curr_extrinsic[:3,:3] @ R_root
200
201 target_extrinsic[:3, -1] = curr_extrinsic[:3,:3] @ (smpl_trans + T_hip) + curr_extrinsic[:3, -1] - smpl_trans - target_extrinsic[:3,:3] @ T_hip
202
203 smpl_pose[:3] = cv2.Rodrigues(transf_global_ori)[0].reshape(3)
204 smpl_trans = np.linalg.inv(target_extrinsic[:3,:3]) @ smpl_trans # we assume
205
206 return target_extrinsic, smpl_pose, smpl_trans
207
208class GMoF(nn.Module):
209 def __init__(self, rho=1):

Callers 1

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected