keypoints_to_lengths

hybrid_learning.datasets.custom.person_size_estimation.keypoints_to_lengths(kpts, includes=None, factors=           bbox_width  bbox_height  ...  upper_arm  lower_arm slope               1            1  ...     3.7200     4.4600 intersect           0            0  ...     0.4486     0.5694  [2 rows x 11 columns])[source]

Estimate different skeletal lengths from given 2D joint coordinates. Due to 2D projection, the maximum estimate is returned for any body part. Joints may be marked as excluded from calculation by mapping their bool value to False or 0 in includes (e.g. use to exclude keypoints which are not in an image).

To infer the length of body parts for which information is missing, the given factors and further relations listed below are used. It is assumed that factors represents parameters to linearly estimate the same size (not necessarily the body size) from different body part sizes. Further used approximate relations from arts best-practice:

Estimated lengths (index of returned pandas.Series): long bones (see _lengths_of_long_bones()), hip_to_shoulder, arm, leg, shoulder_width, wrist_to_wrist, body_height, head_width, head_height

Assumed given joint names: left_ear, right_ear, left_eye, right_eye, nose, and those needed by _lengths_of_long_bones()

Parameters
  • kpts (Mapping[str, ndarray]) – mapping of joint identifier to x-y-coordinate

  • includes (Optional[Mapping[str, Union[bool, int]]]) – mapping of joint identifier to bool stating whether to assume the joint information as known and include the joint in calculations; see _length_of_links()

  • factors – parameter information of the same form as FACTORS; it is not required that the linear formulas represented there calculate the body height, but they must all calculate the same size estimate

Returns

a pandas.Series with the length identifier as index names and the float lengths as values

Return type

Dict[str, float]