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

Method __init__

detrsmpl/models/registrants/smplify.py:54–155  ·  view source on GitHub ↗

Args: body_model: config or an object of body model. num_epochs: number of epochs of registration camera: config or an object of camera img_res: image resolution. If tuple, values are (width, height) stages: config of registration

(self,
                 body_model: Union[dict, torch.nn.Module],
                 num_epochs: int = 20,
                 camera: Union[dict, torch.nn.Module] = None,
                 img_res: Union[Tuple[int], int] = 224,
                 stages: dict = None,
                 optimizer: dict = None,
                 keypoints2d_loss: dict = None,
                 keypoints3d_loss: dict = None,
                 shape_prior_loss: dict = None,
                 joint_prior_loss: dict = None,
                 smooth_loss: dict = None,
                 pose_prior_loss: dict = None,
                 pose_reg_loss: dict = None,
                 limb_length_loss: dict = None,
                 use_one_betas_per_video: bool = False,
                 ignore_keypoints: List[int] = None,
                 device=torch.device(
                     'cuda' if torch.cuda.is_available() else 'cpu'),
                 verbose: bool = False)

Source from the content-addressed store, hash-verified

52 """
53
54 def __init__(self,
55 body_model: Union[dict, torch.nn.Module],
56 num_epochs: int = 20,
57 camera: Union[dict, torch.nn.Module] = None,
58 img_res: Union[Tuple[int], int] = 224,
59 stages: dict = None,
60 optimizer: dict = None,
61 keypoints2d_loss: dict = None,
62 keypoints3d_loss: dict = None,
63 shape_prior_loss: dict = None,
64 joint_prior_loss: dict = None,
65 smooth_loss: dict = None,
66 pose_prior_loss: dict = None,
67 pose_reg_loss: dict = None,
68 limb_length_loss: dict = None,
69 use_one_betas_per_video: bool = False,
70 ignore_keypoints: List[int] = None,
71 device=torch.device(
72 'cuda' if torch.cuda.is_available() else 'cpu'),
73 verbose: bool = False) -> None:
74 """
75 Args:
76 body_model: config or an object of body model.
77 num_epochs: number of epochs of registration
78 camera: config or an object of camera
79 img_res: image resolution. If tuple, values are (width, height)
80 stages: config of registration stages
81 optimizer: config of optimizer
82 keypoints2d_loss: config of keypoint 2D loss
83 keypoints3d_loss: config of keypoint 3D loss
84 shape_prior_loss: config of shape prior loss.
85 Used to prevent extreme shapes.
86 joint_prior_loss: config of joint prior loss.
87 Used to prevent large joint rotations.
88 smooth_loss: config of smooth loss.
89 Used to prevent jittering by temporal smoothing.
90 pose_prior_loss: config of pose prior loss.
91 Used to prevent unnatural pose.
92 pose_reg_loss: config of pose regularizer loss.
93 Used to prevent pose being too large.
94 limb_length_loss: config of limb length loss.
95 Used to prevent the change of body shape.
96 use_one_betas_per_video: whether to use the same beta parameters
97 for all frames in a single video sequence.
98 ignore_keypoints: list of keypoint names to ignore in keypoint
99 loss computation
100 device: torch device
101 verbose: whether to print information during registration
102
103 Returns:
104 None
105 """
106
107 self.use_one_betas_per_video = use_one_betas_per_video
108 self.num_epochs = num_epochs
109 self.img_res = img_res
110 self.device = device
111 self.stage_config = stages

Callers

nothing calls this directly

Calls 6

_set_keypoint_idxsMethod · 0.95
build_camerasFunction · 0.90
build_lossFunction · 0.85
build_body_modelFunction · 0.85
deviceMethod · 0.80
toMethod · 0.45

Tested by

no test coverage detected