MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / load_from_kp2ds

Method load_from_kp2ds

tools/preprocess/pose2d_utils.py:169–195  ·  view source on GitHub ↗

input 133x3 numpy keypoints and output AAPoseMeta Args: kp2ds (List[np.ndarray]): _description_ width (int): _description_ height (int): _description_ Returns: _type_: _description_

(kp2ds: List[np.ndarray], width: int, height: int)

Source from the content-addressed store, hash-verified

167
168 @staticmethod
169 def load_from_kp2ds(kp2ds: List[np.ndarray], width: int, height: int):
170 """input 133x3 numpy keypoints and output AAPoseMeta
171
172 Args:
173 kp2ds (List[np.ndarray]): _description_
174 width (int): _description_
175 height (int): _description_
176
177 Returns:
178 _type_: _description_
179 """
180 pose_meta = AAPoseMeta()
181 pose_meta.width = width
182 pose_meta.height = height
183 kps_body = (kp2ds[[0, 6, 6, 8, 10, 5, 7, 9, 12, 14, 16, 11, 13, 15, 2, 1, 4, 3, 17, 20]] + kp2ds[[0, 5, 6, 8, 10, 5, 7, 9, 12, 14, 16, 11, 13, 15, 2, 1, 4, 3, 18, 21]]) / 2
184 kps_lhand = kp2ds[91:112]
185 kps_rhand = kp2ds[112:133]
186 kps_face = np.concatenate([kp2ds[23 : 23 + 68], kp2ds[1:3]], axis=0)
187 pose_meta.kps_body = kps_body[:, :2]
188 pose_meta.kps_body_p = kps_body[:, 2]
189 pose_meta.kps_lhand = kps_lhand[:, :2]
190 pose_meta.kps_lhand_p = kps_lhand[:, 2]
191 pose_meta.kps_rhand = kps_rhand[:, :2]
192 pose_meta.kps_rhand_p = kps_rhand[:, 2]
193 pose_meta.kps_face = kps_face[:, :2]
194 pose_meta.kps_face_p = kps_face[:, 2]
195 return pose_meta
196
197 @staticmethod
198 def from_dwpose(dwpose_det_res, height, width):

Callers 1

__init__Method · 0.95

Calls 1

AAPoseMetaClass · 0.85

Tested by

no test coverage detected