def __init__(self, JOINT_REGRESSOR_H36M='data/J_regressor_h36m.npy', **kwargs): super().__init__(**kwargs) self.J_regressor = torch.from_numpy(np.load(JOINT_REGRESSOR_H36M)).float() self.p1_meter = AverageMeter('P1', ':.2f') self.p2_meter = AverageMeter('P2', ':.2f') self.p3_meter = AverageMeter('P3', ':.2f') self.stats = list() self.mismatch_cnt = 0 # Initialize SMPL model openpose_joints = [24, 12, 17, 19, 21, 16, 18, 20, 0, 2, 5, 8, 1, 4, 7, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34] extra_joints = [8, 5, 45, 46, 4, 7, 21, 19, 17, 16, 18, 20, 47, 48, 49, 50, 51, 52, 53, 24, 26, 25, 28, 27] joints = torch.tensor(openpose_joints + extra_joints, dtype=torch.int32) joint_mapper = JointMapper(joints) smpl_params = dict(model_folder='data/smpl', joint_mapper=joint_mapper, create_glb_pose=True, body_pose_param='identity', create_body_pose=True, create_betas=True, # create_trans=True, dtype=torch.float32, vposer_ckpt=None, gender='neutral') self.smpl = SMPL(**smpl_params) self.J_regressor = torch.from_numpy(np.load(JOINT_REGRESSOR_H36M)).float() self.result_list = list() self.result_list_2d = list() self.h36m_to_MPI = [10, 8, 14, 15, 16, 11, 12, 13, 4, 5, 6, 1, 2, 3, 0, 7, 9] self.collision_meter = AverageMeter('collision', ':.2f') self.collision_volume = CollisionVolume(self.smpl.faces, grid_size=64).cuda() self.coll_cnt = 0
def __init__(self, JOINT_REGRESSOR_H36M='data/J_regressor_h36m.npy', **kwargs): super().__init__(**kwargs) self.J_regressor = torch.from_numpy( np.load(JOINT_REGRESSOR_H36M)).float() self.p1_meter = AverageMeter('P1', ':.2f') self.p2_meter = AverageMeter('P2', ':.2f') self.p3_meter = AverageMeter('P3', ':.2f') self.stats = list() self.mismatch_cnt = 0 # Initialize SMPL model openpose_joints = [ 24, 12, 17, 19, 21, 16, 18, 20, 0, 2, 5, 8, 1, 4, 7, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34 ] extra_joints = [ 8, 5, 45, 46, 4, 7, 21, 19, 17, 16, 18, 20, 47, 48, 49, 50, 51, 52, 53, 24, 26, 25, 28, 27 ] joints = torch.tensor(openpose_joints + extra_joints, dtype=torch.int32) self.smpl = SMPL('data/smpl') self.J_regressor = torch.from_numpy( np.load(JOINT_REGRESSOR_H36M)).float() self.result_list = list() self.result_list_2d = list() self.h36m_to_MPI = [ 10, 8, 14, 15, 16, 11, 12, 13, 4, 5, 6, 1, 2, 3, 0, 7, 9 ] self.collision_meter = AverageMeter('collision', ':.2f') self.collision_volume = CollisionVolume(self.smpl.faces, grid_size=64).cuda() self.coll_cnt = 0
def __init__(self, JOINT_REGRESSOR_H36M='data/J_regressor_h36m.npy', **kwargs): super().__init__(**kwargs) self.J_regressor = torch.from_numpy( np.load(JOINT_REGRESSOR_H36M)).float() self.p1_meter = AverageMeter('P1', ':.2f') self.stats = list() self.mismatch_cnt = 0 # Initialize SMPL model openpose_joints = [ 24, 12, 17, 19, 21, 16, 18, 20, 0, 2, 5, 8, 1, 4, 7, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34 ] extra_joints = [ 8, 5, 45, 46, 4, 7, 21, 19, 17, 16, 18, 20, 47, 48, 49, 50, 51, 52, 53, 24, 26, 25, 28, 27 ] joints = torch.tensor(openpose_joints + extra_joints, dtype=torch.int32) self.smpl = SMPL('data/smpl') self.J_regressor = torch.from_numpy( np.load(JOINT_REGRESSOR_H36M)).float() self.collision_meter = AverageMeter('P3', ':.2f') self.collision_volume = CollisionVolume(self.smpl.faces, grid_size=64).cuda() self.coll_cnt = 0 self.threshold_list = [0.1, 0.15, 0.2] self.total_ordinal_cnt = {i: 0 for i in self.threshold_list} self.correct_ordinal_cnt = {i: 0 for i in self.threshold_list}
def __init__(self, JOINT_REGRESSOR_H36M='data/J_regressor_h36m.npy', pattern='.60457274_', **kwargs): super().__init__(**kwargs) self.J_regressor = torch.from_numpy( np.load(JOINT_REGRESSOR_H36M)).float() self.pattern = pattern self.p1_meter = AverageMeter('P1', ':.2f') self.p2_meter = AverageMeter('P2', ':.2f')