11
22import numpy as np
33
4- from human_body_prior .tools .omni_tools import copy2cpu as c2c
54from NiLBS .pose .util import pose_from_smplh
65
76class PoseSamplerAMASS :
@@ -16,12 +15,13 @@ class PoseSamplerAMASS:
1615 def __init__ (self , body_model , bdata ):
1716 """
1817
19- :param body_model: human_body_prior.BodyModel
18+ :param body_model: HumanBody
2019 :param bdata: .npz file, must contain the following attributes: 'poses'
2120 """
22- self .v_template = c2c (body_model .v_template )[0 ]
23- self .bone_hierachy = c2c (body_model .kintree_table )
24- self .j_regressor = body_model .J_regressor
21+ self .v_template = body_model .vertex_template
22+ self .bone_hierachy = body_model .bone_hierarchy
23+ #self.j_regressor = body_model.J_regressor
24+ self .joints = body_model .joints
2525 self .bdata = bdata
2626
2727 def sample_frames (self , n_frames = - 1 , step = 1 , offset = 0 ):
@@ -46,7 +46,7 @@ def sample_frames(self, n_frames=-1, step=1, offset=0):
4646 pose_hand = self .bdata ['poses' ][i :i + 1 , 66 :]
4747
4848 full_pose = np .concatenate ((root_orient , pose_body ), axis = 1 ).transpose ()
49- pose = pose_from_smplh (self .v_template , full_pose , self .bone_hierachy , self .j_regressor )
49+ pose = pose_from_smplh (self .v_template , full_pose , self .bone_hierachy , self .joints )
5050
5151 poses .append (pose )
5252
0 commit comments