imgutils.pose.visual

op18_visualize

imgutils.pose.visual.op18_visualize(image: str | PathLike | bytes | bytearray | BinaryIO | Image, keypoints_list: List[OP18KeyPointSet], threshold: float = 0.3, min_edge_size: int | None = 512, draw_body: bool = True, draw_hands: bool = True, draw_feet: bool = True, draw_face: bool = True) Image[source]

Visualize the keypoint information of animated characters using the OP18 model on an image.

This function takes an input image and a list of OP18 keypoint sets for animated characters, and visualizes the keypoint information on the image. It supports drawing the body, hands, feet, and face of the characters based on the provided keypoint sets.

Parameters:
  • image (ImageTyping) – The input image to visualize.

  • keypoints_list (List[OP18KeyPointSet]) – List of OP18KeyPointSet objects containing keypoint information for characters.

  • threshold (float, optional) – Keypoint detection threshold. Keypoints with a confidence score below this threshold will not be drawn.

  • min_edge_size (int, optional) – Minimum size for the shorter edge of the output image. If the original image is larger, it will be resized.

  • draw_body (bool) – If True, draw lines connecting keypoints for the body. Default is True.

  • draw_hands (bool) – If True, draw lines connecting keypoints for the hands. Default is True.

  • draw_feet (bool) – If True, draw lines connecting keypoints for the feet. Default is True.

  • draw_face (bool) – If True, draw ellipses around facial keypoints. Default is True.

Returns:

The image with visualized keypoint information.

Return type:

Image.Image