| 470 | |
| 471 | |
| 472 | class SMPLH(SMPL): |
| 473 | |
| 474 | # The hand joints are replaced by MANO |
| 475 | NUM_BODY_JOINTS = SMPL.NUM_JOINTS - 2 |
| 476 | NUM_HAND_JOINTS = 15 |
| 477 | NUM_JOINTS = NUM_BODY_JOINTS + 2 * NUM_HAND_JOINTS |
| 478 | |
| 479 | def __init__(self, |
| 480 | model_path, |
| 481 | data_struct: Optional[Struct] = None, |
| 482 | create_left_hand_pose: bool = True, |
| 483 | left_hand_pose: Optional[Tensor] = None, |
| 484 | create_right_hand_pose: bool = True, |
| 485 | right_hand_pose: Optional[Tensor] = None, |
| 486 | use_pca: bool = True, |
| 487 | num_pca_comps: int = 6, |
| 488 | flat_hand_mean: bool = False, |
| 489 | batch_size: int = 1, |
| 490 | gender: str = 'neutral', |
| 491 | dtype=torch.float32, |
| 492 | vertex_ids=None, |
| 493 | use_compressed: bool = True, |
| 494 | ext: str = 'pkl', |
| 495 | **kwargs) -> None: |
| 496 | """SMPLH model constructor. |
| 497 | |
| 498 | Parameters |
| 499 | ---------- |
| 500 | model_path: str |
| 501 | The path to the folder or to the file where the model |
| 502 | parameters are stored |
| 503 | data_struct: Strct |
| 504 | A struct object. If given, then the parameters of the model are |
| 505 | read from the object. Otherwise, the model tries to read the |
| 506 | parameters from the given `model_path`. (default = None) |
| 507 | create_left_hand_pose: bool, optional |
| 508 | Flag for creating a member variable for the pose of the left |
| 509 | hand. (default = True) |
| 510 | left_hand_pose: torch.tensor, optional, BxP |
| 511 | The default value for the left hand pose member variable. |
| 512 | (default = None) |
| 513 | create_right_hand_pose: bool, optional |
| 514 | Flag for creating a member variable for the pose of the right |
| 515 | hand. (default = True) |
| 516 | right_hand_pose: torch.tensor, optional, BxP |
| 517 | The default value for the right hand pose member variable. |
| 518 | (default = None) |
| 519 | num_pca_comps: int, optional |
| 520 | The number of PCA components to use for each hand. |
| 521 | (default = 6) |
| 522 | flat_hand_mean: bool, optional |
| 523 | If False, then the pose of the hand is initialized to False. |
| 524 | batch_size: int, optional |
| 525 | The batch size used for creating the member variables |
| 526 | gender: str, optional |
| 527 | Which gender to load |
| 528 | dtype: torch.dtype, optional |
| 529 | The data type for the created variables |