pocketpose.models.body.rtmpose - PocketPose 0.0.1 documentation

Hide navigation sidebar
Hide table of contents sidebar
Back to top
Edit this page
Toggle table of contents sidebar

# `pocketpose.models.body.rtmpose`

## Module Contents

### Classes

`RTMPose` | Base class for RTMPose models.
`RTMPoseM` | MoveNet Lightning model.

class pocketpose.models.body.rtmpose.RTMPose(model_path: str, model_url: str, input_size: tuple)

  Bases: `pocketpose.models.interfaces.ONNXModel`

  Base class for RTMPose models.

  process_image(image)

    Default implementation of process_image() for models that don’t need preprocessing.

    This method can be overridden by subclasses to implement model-specific preprocessing.

    Args:
      image (np.ndarray): The image to prepare for prediction. The image is a numpy

        array with shape (1, height, width, channels) and dtype uint8 (range [0, 255]).

  postprocess_prediction(prediction, original_size) → List[List[float]]

    Postprocesses the prediction to get the keypoints.

    Args:
      prediction (Any): The raw prediction returned by the model. This can

        be a single tensor or a tuple of tensors, depending on the model.

      original_size (tuple): The original size of the input image as (height, width).

    Returns:

      The predicted keypoints as a list of (x, y, score) tuples.

class pocketpose.models.body.rtmpose.RTMPoseM

  Bases: `RTMPose`

  MoveNet Lightning model.