nicetoolbox.detectors.method_detectors.mmpose.mmpose_framework_base¶
Base integration of the MMPose framework into the NICE toolbox pipeline.
Functions
Extracts keys from a dictionary based on the type of their values. |
Classes
The BaseMMPose class is a parent method detector for pose estimation using the MMPose framework. |
- class nicetoolbox.detectors.method_detectors.mmpose.mmpose_framework_base.BaseMMPose(io: SequenceIO, data: SequenceData, sequence_context: SequenceRuntimeConfig, algorithm_instance: str)[source]¶
The BaseMMPose class is a parent method detector for pose estimation using the MMPose framework. It holds shared initialization and visualization logic for both 2D and 3D subclasses.
Initialize base method detector with references.
- abstract get_per_component_keypoint_mapping(keypoints_indices) Tuple[Dict[str, List[int]], Dict[str, List[str]]][source]¶
This method extracts the keypoint indices and descriptions for each pose estimation component.
It has to be implemented by the derived classes associated to the available pose estimation algorithms. (See HRNetw48 and Vitpose classes below)
Available algorithms are: hrnetw48, vitpose
- Parameters:
keypoints_indices (_type_) – _description_
- visualization(data)[source]¶
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.
- nicetoolbox.detectors.method_detectors.mmpose.mmpose_framework_base.extract_key_per_value(input_dict)[source]¶
Extracts keys from a dictionary based on the type of their values.
If all values in the dictionary are integers, it returns a list of keys. If any value is a list, it appends an index to the key to create a unique key.
- Parameters:
input_dict (dict) – The input dictionary to extract keys from.
- Returns:
A list of keys extracted from the input dictionary.
- Return type:
return_keys (list)
- Raises:
NotImplementedError – If a value in the dictionary is neither an integer nor a
list. –