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

Method from_humanapi_meta

tools/preprocess/pose2d_utils.py:128–142  ·  view source on GitHub ↗
(meta)

Source from the content-addressed store, hash-verified

126
127 @staticmethod
128 def from_humanapi_meta(meta):
129 pose_meta = AAPoseMeta()
130 width, height = meta["width"], meta["height"]
131 pose_meta.width = width
132 pose_meta.height = height
133 pose_meta.kps_body = meta["keypoints_body"][:, :2] * (width, height)
134 pose_meta.kps_body_p = meta["keypoints_body"][:, 2]
135 pose_meta.kps_lhand = meta["keypoints_left_hand"][:, :2] * (width, height)
136 pose_meta.kps_lhand_p = meta["keypoints_left_hand"][:, 2]
137 pose_meta.kps_rhand = meta["keypoints_right_hand"][:, :2] * (width, height)
138 pose_meta.kps_rhand_p = meta["keypoints_right_hand"][:, 2]
139 if "keypoints_face" in meta:
140 pose_meta.kps_face = meta["keypoints_face"][:, :2] * (width, height)
141 pose_meta.kps_face_p = meta["keypoints_face"][:, 2]
142 return pose_meta
143
144 def load_from_meta(self, meta, norm_body=True, norm_hand=False):
145 self.image_id = meta.get("image_id", "00000.png")

Callers 1

__call__Method · 0.80

Calls 1

AAPoseMetaClass · 0.85

Tested by

no test coverage detected