pose_format.utils.holistic module

Functions:

FACE_POINTS([additional_points])

Makes a list of string representations of face points indexes up to total face points number

FACE_POINTS_NUM([additional_points])

Gets total number of face points and additional points.

body_points(component, width, height, num)

gets body points

component_points(component, width, height, num)

Gets component points

formatted_holistic_pose(width, height[, ...])

Formatted holistic pose

holistic_components([pf, additional_face_points])

Creates list of holistic components

holistic_hand_component(name[, pf])

Creates holistic hand component

load_holistic(frames[, fps, width, height, ...])

Loads holistic pose data

load_mediapipe_directory(directory, fps, ...)

Load pose data from a directory of MediaPipe

process_holistic(frames, fps, w, h[, ...])

process frames using holistic model from mediapipe

pose_format.utils.holistic.FACE_POINTS(additional_points=0)

Makes a list of string representations of face points indexes up to total face points number

Parameters:

additional_points (int, optional) – number of additional points to be considered. Defaults to 0

Returns:

List of strings of face point indices.

Return type:

list[str]

pose_format.utils.holistic.FACE_POINTS_NUM(additional_points=0)

Gets total number of face points and additional points.

Parameters:

additional_points (int, optional) – number of additional points to be added. The defaults is 0.

Returns:

total number of face points.

Return type:

int

pose_format.utils.holistic.body_points(component, width, height, num)[source]

gets body points

Parameters:
  • component (object) – component containing landmarks

  • width (int) – width

  • height (int) – Height

  • num (int) – number of landmarks

Returns:

coordinates and visibility for each landmark.

Return type:

tuple of np.array

pose_format.utils.holistic.component_points(component, width, height, num)[source]

Gets component points

Parameters:
  • component (object) – Component with landmarks

  • width (int) – Width

  • height (int) – Height

  • num (int) – number of landmarks

Returns:

coordinates and confidence for each landmark

Return type:

tuple of np.array

pose_format.utils.holistic.formatted_holistic_pose(width, height, additional_face_points=0)[source]

Formatted holistic pose

Parameters:
  • width (int) – Pose width.

  • height (int) – Pose height.

  • additional_face_points (int, optional) – Additional face points/landmarks.

Returns:

Formatted pose components

Return type:

object

pose_format.utils.holistic.holistic_components(pf='XYZC', additional_face_points=0)[source]

Creates list of holistic components

Parameters:
  • pf (str, optional) – Point format

  • additional_face_points (int, optional) – Additional face points/landmarks

Returns:

List of holistic components.

Return type:

list of PoseHeaderComponent

pose_format.utils.holistic.holistic_hand_component(name, pf='XYZC')[source]

Creates holistic hand component

Parameters:
  • name (str) – Component name

  • pf (str, optional) – Point format

Returns:

Hand component

Return type:

PoseHeaderComponent

pose_format.utils.holistic.load_holistic(frames, fps=24, width=1000, height=1000, depth=0, kinect=None, progress=False, additional_holistic_config={})[source]

Loads holistic pose data

Parameters:
  • frames (list) – List of frames.

  • fps (float, optional) – Frames per second.

  • width (int, optional) – Frame width.

  • height (int, optional) – Frame height.

  • depth (int, optional) – Depth data.

  • kinect (object, optional) – Kinect depth data.

  • progress (bool, optional) – If True, show the progress bar.

  • additional_holistic_config (dict, optional) – Additional configurations for the holistic model.

Returns:

Loaded pose data with header and body

Return type:

Pose

pose_format.utils.holistic.load_mediapipe_directory(directory, fps, width, height, num_face_points=128)[source]

Load pose data from a directory of MediaPipe

Parameters:
  • directory (str) – Directory path.

  • fps (float) – Frames per second.

  • width (int) – Frame width.

  • height (int) – Frame height.

  • num_face_points (int, optional) – Number of face landmarks. Ideally, we don’t want to hard code the 128 for the face, since face points can be 128 (reduced with refinement) or 118 (reduced without refinement) or 478 (full with refinement) or 468 (full without refinement)

Returns:

Loaded pose data

Return type:

Pose

pose_format.utils.holistic.process_holistic(frames, fps, w, h, kinect=None, progress=False, additional_face_points=0, additional_holistic_config={})[source]

process frames using holistic model from mediapipe

Parameters:
  • frames (list) – List of frames to be processed

  • fps (float) – Frames per second

  • w (int) – Frame width

  • h (int) – Frame height.

  • kinect (object, optional) – Kinect depth data.

  • progress (bool, optional) – If True, show the progress bar.

  • additional_face_points (int, optional) – Additional face landmarks (points)

  • additional_holistic_config (dict, optional) – Additional configurations for holistic model

Returns:

Processed pose data

Return type:

NumPyPoseBody