Skip to main content

HumanSkeletonMixin

HumanSkeletonMixin is the pose-estimation primitive implemented in src/autopipeline/components/primitives/human_skeleton.py.

It is a narrow reusable helper for producing pose landmarks used by body-structure metrics.

Mixin
Signature

Class Signature

HumanSkeletonMixin(**kwargs)
Constructor

Constructor Parameters

KeyDefaultMeaning
static_modeTrueRun MediaPipe Pose in static-image mode.
model_complexity0MediaPipe Pose model complexity.
min_detection_confidence0.5Detection confidence threshold.

The implementation always sets:

  • enable_segmentation=False
Methods

Public Methods

MethodPurpose
get_skeleton_np(image)Run pose estimation and return landmark coordinates.
Methods

Method Reference

get_skeleton_np(image: Image.Image)

Input

ParameterMeaning
imagePIL image containing a person.

Output

Returns:

  • np.ndarray of pose landmarks with rows [x, y, z, visibility]
  • None if no pose landmarks are found

The coordinates are normalized MediaPipe pose coordinates, not pixel-space coordinates.

Config

Minimal Integration Example

init_config:
static_mode: true
model_complexity: 1
min_detection_confidence: 0.5
Failure Mode

Failure Semantics

Soft-failure behavior:

  • no pose landmarks -> returns None

Initialization or MediaPipe runtime failures are not wrapped in a custom recovery layer.

Extension

Extension Notes

  • Keep general-purpose pose extraction here.
  • Keep metric-specific body alignment or scoring above this layer.
  • If you add a new body metric, document whether it expects normalized landmarks or pixel-space landmarks after post-processing.