def __init__(self, name, has_3d, reorder=None, face_and_shoulder=None, lsp_only=False): # for custom regressors add the corresponding keypoints to universal order # this will force all datasets to add the given keypoint if available else # will pad it with [0, 0] and visibility 0 self.universal_order = [ 'toes_r', 'ankle_r', 'knee_r', 'hip_r', 'hip_l', 'knee_l', 'ankle_l', 'toes_l', 'wrist_r', 'elbow_r', 'shoulder_r', 'shoulder_l', 'elbow_l', 'wrist_l', 'neck', 'brain' ] default_face_and_shoulder = [ 'shoulder_l', 'shoulder_r', 'neck', 'brain' ] if face_and_shoulder is not None: # merge face and shoulder kps without duplicate face_and_shoulder = list( set(face_and_shoulder + default_face_and_shoulder)) else: face_and_shoulder = default_face_and_shoulder self.body_idx = [ i for i, kp in enumerate(self.universal_order) if kp not in face_and_shoulder ] self.lsp_only = lsp_only self.name = check_type('name', name, str) self.has_3d = check_type('has_3d', has_3d, int) self.reorder = self.__create_reorder_idx( reorder) if reorder is not None else None
def __init__(self, config: DataSetConfig, image_paths, kps_2d, vis=None, kps_3d=None, seqs=None): self.config = config self.image_paths = check_type('image_paths', image_paths, np.ndarray) self.kps_2d = check_type('2d keypoints', kps_2d, np.ndarray) self.vis = check_type('visibility', vis, np.ndarray) if vis is not None else None self.kps_3d = check_type('3d keypoints', kps_3d, np.ndarray) if kps_3d is not None else None self.seqs = check_type('sequences', seqs, np.ndarray) if seqs is not None else None
def __init__(self, config: SmplDataSetConfig, poses, shapes=None): self.config = config self.poses = check_type('poses', poses, np.ndarray) self.shapes = check_type('shapes', shapes, np.ndarray) if shapes is not None else None
def __init__(self, name): self.name = check_type('name', name, str)