tool¶
MediaPipe pose estimation tool.
Classes
MediaPipe pose estimation tool. |
- class MediaPipePoseEstimationTool(model_complexity=2, smooth=True, device='cpu', overwrite=False, verbose=True)[source]¶
Bases:
PoseEstimationToolMediaPipe pose estimation tool.
- Parameters:
model_complexity (
int) – Complexity of the model: {0, 1, 2}, higher means more FLOPs, but also more accurate resultssmooth (
bool) – Whether to temporally smooth the inference results to reduce the jitter.device (
str) – The device where the computation should be executed.overwrite (
bool) – Whether to overwrite existing files, otherwise raise an error.verbose (
Union[bool,int]) – Whether to execute the computation verbosely.
- inference(video_path, poses_path)[source]¶
Runs MediaPipe pose estimation model on a video.
- Parameters:
video_path (
Union[str,Path]) – Path to the video file.poses_path (
Union[str,Path]) – Path to the pose archive.
- Returns:
- process_part(landmarks, size, n_points)[source]¶
Processes MediaPipe output into a simple flattened list of coordinates.
- Parameters:
landmarks – MediaPipe landmarks.
size (
Tuple[int,int]) – Image resolution.n_points (
int) – Expected number of points.
- Return type:
List[float]- Returns:
Processed keypoint coordinates.