imgutils.pose.dwpose

Overview:

Detect human keypoints in anime images.

The model is from https://github.com/IDEA-Research/DWPose.

../../_images/dwpose_demo.plot.py.svg

This is an overall benchmark of all the keypoint detect models:

../../_images/dwpose_benchmark.plot.py.svg

dwpose_estimate

imgutils.pose.dwpose.dwpose_estimate(image: str | PathLike | bytes | bytearray | BinaryIO | Image, auto_detect: bool = True, out_bboxes=None, person_detect_cfgs=None) List[OP18KeyPointSet][source]

Performs inference on the RTMPose model and returns keypoints and scores.

Parameters:
Returns:

List of mapping of different parts, including all, head, body, foot, hand1 and hand2.

Return type:

List[OP18KeyPointSet]

Examples:
>>> from imgutils.data import load_image
>>> from imgutils.pose import dwpose_estimate, op18_visualize
>>>
>>> image = load_image('dwpose/squat.jpg')
>>> keypoints = dwpose_estimate(image)
>>> keypoints
[<imgutils.pose.format.OP18KeyPointSet object at 0x7f5ca933f3d0>]
>>>
>>> from matplotlib import pyplot as plt
>>> plt.imshow(op18_visualize(image, keypoints))
<matplotlib.image.AxesImage object at 0x7f5c98069790>
>>> plt.show()

Note

Function imgutils.pose.visual.op18_visualize() can be used to visualize this result.