Load the SMPL model. :param gender: 'neutral', 'male', or 'female' :param model_path: Path to the SMPL model files :return: SMPL model
(gender='neutral', model_path='data/body_models/smpl', batch_size=1, device='cuda')
| 21 | } |
| 22 | |
| 23 | def get_smpl_model(gender='neutral', model_path='data/body_models/smpl', batch_size=1, device='cuda'): |
| 24 | """ |
| 25 | Load the SMPL model. |
| 26 | :param gender: 'neutral', 'male', or 'female' |
| 27 | :param model_path: Path to the SMPL model files |
| 28 | :return: SMPL model |
| 29 | """ |
| 30 | kwargs = {'model_path': model_path, |
| 31 | 'gender': 'neutral', |
| 32 | 'num_betas': 16, |
| 33 | 'batch_size': batch_size, |
| 34 | 'use_pca': False} |
| 35 | smpl_model = SMPL(**kwargs).to(device) |
| 36 | return smpl_model |
| 37 | |
| 38 | def smpl_to_joints_and_verts(smpl_model, smpl_params): |
| 39 | """ |
no outgoing calls
no test coverage detected