MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / __init__

Method __init__

util/smplx/smplx/body_models.py:479–631  ·  view source on GitHub ↗

SMPLH model constructor. Parameters ---------- model_path: str The path to the folder or to the file where the model parameters are stored data_struct: Strct A struct object. If given, then the parameters of the model are

(self,
                 model_path,
                 data_struct: Optional[Struct] = None,
                 create_left_hand_pose: bool = True,
                 left_hand_pose: Optional[Tensor] = None,
                 create_right_hand_pose: bool = True,
                 right_hand_pose: Optional[Tensor] = None,
                 use_pca: bool = True,
                 num_pca_comps: int = 6,
                 flat_hand_mean: bool = False,
                 batch_size: int = 1,
                 gender: str = 'neutral',
                 dtype=torch.float32,
                 vertex_ids=None,
                 use_compressed: bool = True,
                 ext: str = 'pkl',
                 **kwargs)

Source from the content-addressed store, hash-verified

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
530 vertex_ids: dict, optional
531 A dictionary containing the indices of the extra vertices that
532 will be selected
533 """
534
535 self.num_pca_comps = num_pca_comps
536 # If no data structure is passed, then load the data from the given

Callers

nothing calls this directly

Calls 5

create_mean_poseMethod · 0.95
StructClass · 0.85
to_tensorFunction · 0.70
loadMethod · 0.45
__init__Method · 0.45

Tested by

no test coverage detected