nicetoolbox.detectors.method_detectors.mmpose.mmpose_framework_2d.MMPose2D

class nicetoolbox.detectors.method_detectors.mmpose.mmpose_framework_2d.MMPose2D(io: SequenceIO, data: SequenceData, sequence_context: SequenceRuntimeConfig, algorithm_instance: str)[source]

Bases: BaseMMPose

The MMPose2D class is a method detector for 2D pose estimation using the MMPose framework.

Its post_inference method computes 3D points via multi-view stereo triangulation. components is set per-instance from the TOML config (e.g. body-only models declare components = [“body_joints”], wholebody models declare [“body_joints”, “hand_joints”, “face_landmarks”]).

Initialize base method detector with references.

Methods

compute_output_folders

Compute extra output folders for all components.

compute_result_folders

Compute result folders for all components.

compute_viz_folders

Compute visualization folders for all components.

get_per_component_keypoint_mapping

Build per-component keypoint index/description maps based on the components this instance was configured to produce.

post_inference

Post-inference processing for pose estimation components such as body_joints, hand_joints, and face_landmarks.

run

Execute method detector: run subprocess inference + post_inference.

visualization

Generates a visualization video for each camera from the processed image frames.

Attributes

algorithm_type

inference_package_name

predictions_mapping

Access predictions mapping from runtime config.

runtime

os_type

conda_path

venv

env_name

script_path

visualize

requires_out_folder

out_folders

result_folders

viz_folders

config_paths

data

io

sequence_context

detector_config

algorithm_instance

inference_config

components

compute_output_folders(requires_out_folder: bool) Dict[str, str]

Compute extra output folders for all components.

compute_result_folders() Dict[str, str]

Compute result folders for all components.

compute_viz_folders(visualize: bool) Dict[str, str]

Compute visualization folders for all components.

get_per_component_keypoint_mapping(keypoints_indices)[source]

Build per-component keypoint index/description maps based on the components this instance was configured to produce.

  • body_joints: when components include hand_joints or face_landmarks we treat the model as wholebody and union body + foot keypoints; otherwise we use the body block only.

  • hand_joints / face_landmarks: straightforward 1:1 mapping.

post_inference()[source]

Post-inference processing for pose estimation components such as body_joints, hand_joints, and face_landmarks.

See module docstring for the full description of steps and outputs.

property predictions_mapping

Access predictions mapping from runtime config.

run() None

Execute method detector: run subprocess inference + post_inference.

Returns None - visualization uses external data.

visualization(data)

Generates a visualization video for each camera from the processed image frames.

This method takes the processed image frames for each camera and compiles them into a video file. It uses the frames_to_video() function from utils.video.py. The success of the video creation is tracked, and the method logs the outcome of the visualization process for each camera. :param data: An instance of a class that stores all data related

information, including the frame rate (fps) for the video and the starting frame number (video_start).

Note

  • The method assumes that the processed image frames are named in a

specific format (%09d.jpg), where each frame’s name is a zero-padded five-digit number representing its sequence in the video.