(self)
| 8 | |
| 9 | class SMPLX(object): |
| 10 | def __init__(self): |
| 11 | self.layer_arg = { |
| 12 | 'create_global_orient': False, |
| 13 | 'create_body_pose': False, |
| 14 | 'create_left_hand_pose': False, |
| 15 | 'create_right_hand_pose': False, |
| 16 | 'create_jaw_pose': False, |
| 17 | 'create_leye_pose': False, |
| 18 | 'create_reye_pose': False, |
| 19 | 'create_betas': False, |
| 20 | 'create_expression': False, |
| 21 | 'create_transl': False |
| 22 | } |
| 23 | print(cfg.human_model_path) |
| 24 | self.layer = { |
| 25 | 'neutral': |
| 26 | smplx.create(cfg.human_model_path, |
| 27 | 'smplx', |
| 28 | gender='NEUTRAL', |
| 29 | use_pca=False, |
| 30 | use_face_contour=True, |
| 31 | **self.layer_arg), |
| 32 | 'male': |
| 33 | smplx.create(cfg.human_model_path, |
| 34 | 'smplx', |
| 35 | gender='MALE', |
| 36 | use_pca=False, |
| 37 | use_face_contour=True, |
| 38 | **self.layer_arg), |
| 39 | 'female': |
| 40 | smplx.create(cfg.human_model_path, |
| 41 | 'smplx', |
| 42 | gender='FEMALE', |
| 43 | use_pca=False, |
| 44 | use_face_contour=True, |
| 45 | **self.layer_arg) |
| 46 | } |
| 47 | self.vertex_num = 10475 |
| 48 | self.face = self.layer['neutral'].faces |
| 49 | self.shape_param_dim = 10 |
| 50 | self.expr_code_dim = 10 |
| 51 | with open(osp.join(cfg.human_model_path, 'smplx', 'SMPLX_to_J14.pkl'), |
| 52 | 'rb') as f: |
| 53 | self.j14_regressor = pickle.load(f, encoding='latin1') |
| 54 | with open( |
| 55 | osp.join(cfg.human_model_path, 'smplx', |
| 56 | 'MANO_SMPLX_vertex_ids.pkl'), 'rb') as f: |
| 57 | self.hand_vertex_idx = pickle.load(f, encoding='latin1') |
| 58 | self.face_vertex_idx = np.load( |
| 59 | osp.join(cfg.human_model_path, 'smplx', |
| 60 | 'SMPL-X__FLAME_vertex_ids.npy')) |
| 61 | self.J_regressor = self.layer['neutral'].J_regressor.numpy() |
| 62 | self.J_regressor_idx = { |
| 63 | 'pelvis': 0, |
| 64 | 'lwrist': 20, |
| 65 | 'rwrist': 21, |
| 66 | 'neck': 12 |
| 67 | } |
nothing calls this directly
no test coverage detected