YOLOv8 Pose Keypoints and Output Format Explained

YOLOv8 Pose keypoints represent important landmark positions on detected objects, such as the nose, shoulders, elbows, wrists, hips, knees, and ankles in human pose estimation. A YOLOv8 Pose prediction can include bounding boxes, class information, detection confidence, keypoint coordinates, and keypoint confidence values. Understanding this output format is important when building pose tracking, sports analysis, movement monitoring, or custom keypoint applications.

Table of Contents

Introduction to YOLOv8 Pose Keypoints

YOLOv8 Pose extends normal object detection by predicting landmark coordinates for each detected object.

Instead of only identifying where a person appears in an image, a pose model can estimate the positions of specific body joints. Standard human pose models use the COCO keypoint layout containing 17 human body landmarks.

The result provides more detailed spatial information about an object and allows applications to analyze body posture, movement, joint positions, and relationships between landmarks.

What Are Keypoints in YOLOv8 Pose?

A keypoint is a specific landmark location associated with a detected object.

In human pose estimation, keypoints normally correspond to identifiable body locations such as the nose, eyes, shoulders, wrists, hips, knees, and ankles.

YOLOv8 Pose predicts these landmarks together with object detection information.

Role of Keypoints in Pose Estimation

Keypoints describe the internal structure or pose of an object.

For example, detecting the position of the shoulders, elbows, and wrists allows an application to estimate how a person’s arms are positioned.

The same principle can be applied to other objects using custom keypoint datasets.

A pose model can therefore answer more detailed questions than a standard detector, such as:

  • Where is the person’s left wrist?
  • Is the right knee bent?
  • Where are specific joints located?
  • How are different landmarks positioned relative to one another?

Keypoints vs Bounding Boxes

Bounding boxes and keypoints provide different types of information.

A bounding box represents the overall location and size of an object. It usually contains four spatial values describing the box boundaries or its position and dimensions.

Keypoints represent specific locations inside or around that detected object.

For example, a person may have one bounding box but 17 predicted body keypoints.

Bounding boxes answer where the object is, while keypoints provide information about how the object is positioned or structured.

YOLOv8 Pose Keypoint Structure

Pose predictions are organized as a collection of landmarks for each detected object.

The number and structure of those landmarks depend on the model and dataset used for training.

Standard COCO human pose models use 17 keypoints, while custom models can use a different number. Ultralytics also supports other pose datasets, such as hand datasets with 21 landmarks.

Keypoint Coordinates

Each keypoint contains an x coordinate and a y coordinate that describe its position in the image.

Conceptually, one keypoint may look like:

[x, y]

or, when confidence information is available:

[x, y, confidence]

The x value describes the horizontal position, while y describes the vertical position.

For multiple keypoints, the output becomes a collection of coordinate pairs or triplets.

Keypoint Visibility and Confidence

Pose outputs can contain confidence information for individual keypoints.

This value indicates how reliable the predicted landmark is.

For example, a clearly visible shoulder may receive a stronger confidence value than an ankle hidden behind another object.

Ultralytics’ Keypoints result structure provides access to coordinate and confidence information for pose predictions.

The confidence output should not be confused with the visibility value stored in pose training labels. Visibility is part of annotation information, while inference confidence represents the model’s certainty about the predicted landmark.

Number of Keypoints in a Pose Model

The number of keypoints depends on the dataset used to train the model.

The standard COCO human pose configuration contains 17 keypoints.

A custom pose model can use another number.

For example:

Human pose: 17 keypoints
Hand pose: 21 keypoints
Custom machine: custom number
Animal pose: custom number

The model’s trained keypoint shape determines how many landmark predictions are produced for every detected instance.

YOLOv8 Pose Output Format

A YOLOv8 Pose result combines normal object detection information with pose-specific predictions.

At a high level, the output contains:

  • bounding boxes,
  • classes,
  • detection confidence,
  • keypoint coordinates,
  • keypoint confidence information.

Ultralytics exposes these outputs through its Results, Boxes, and Keypoints objects.

Bounding Box Output

Each detected instance can contain a bounding box around the object.

You can access bounding box information using:

result.boxes

Depending on the property you use, box coordinates can be accessed in formats such as pixel-space xyxy or normalized values.

A pose model still performs object localization because keypoints need to be associated with a specific detected instance.

Class and Confidence Output

Pose results also include object class information.

For standard human COCO Pose models, the relevant object class is typically person.

The detection confidence indicates how confident the model is that the detected bounding box contains the predicted object.

For example:

result.boxes.cls
result.boxes.conf

These detection-level scores are separate from individual keypoint confidence values.

Keypoint Coordinates and Confidence Scores

Pose-specific information is available through:

result.keypoints

Useful properties include:

result.keypoints.xy
result.keypoints.xyn
result.keypoints.conf

xy provides keypoint coordinates in image pixel space, while xyn provides normalized coordinates. conf provides keypoint confidence values when they are present in the output.

Understanding YOLOv8 Pose Tensor Output

The exact low-level tensor representation may vary depending on whether you are reading raw model outputs, exported model outputs, or the processed Ultralytics Results API.

For most application development, using the processed Results object is easier and less error-prone than manually decoding raw tensors.

Output Dimensions and Shape

For processed keypoints, the conceptual structure is generally:

[number_of_detections, number_of_keypoints, values_per_keypoint]

For example, if two people are detected using a 17-keypoint model, the keypoint structure contains information for:

2 detections × 17 keypoints

Each keypoint includes at least x and y coordinates, with confidence information available when supported.

The exact tensor shape should be checked from the model output being used rather than hard-coded across every deployment format.

Reading X and Y Keypoint Coordinates

A simple Python example is:

from ultralytics import YOLO

model = YOLO("yolov8n-pose.pt")
results = model("image.jpg")

for result in results:
    keypoints = result.keypoints.xy
    print(keypoints)

Each keypoint contains an x and y position.

For one detected person, you can access individual landmarks by index:

person_keypoints = result.keypoints.xy[0]

nose = person_keypoints[0]
left_eye = person_keypoints[1]
right_eye = person_keypoints[2]

The keypoint indices correspond to the pose model’s keypoint definition.

Normalized vs Pixel Coordinates

YOLO pose results can be represented using either pixel coordinates or normalized coordinates.

Pixel coordinates describe locations directly relative to the original image size.

For example:

x = 412 pixels
y = 236 pixels

Normalized coordinates typically use values relative to image width and height:

x = 0.64
y = 0.49

Ultralytics exposes pixel coordinates through:

result.keypoints.xy

and normalized coordinates through:

result.keypoints.xyn

This makes it possible to choose the coordinate representation that best fits the application.

COCO Keypoints Used by YOLOv8 Pose

Standard YOLOv8 human pose models use the COCO Pose keypoint layout.

COCO Pose contains 17 human body keypoints.

Complete 17-Keypoint Human Pose Layout

The standard keypoints are:

IndexBody Part
0Nose
1Left Eye
2Right Eye
3Left Ear
4Right Ear
5Left Shoulder
6Right Shoulder
7Left Elbow
8Right Elbow
9Left Wrist
10Right Wrist
11Left Hip
12Right Hip
13Left Knee
14Right Knee
15Left Ankle
16Right Ankle

These indices remain important when reading pose predictions because the position of each landmark inside the keypoint array determines which body part it represents.

Keypoint Index and Body Part Mapping

Suppose the model returns:

keypoints = result.keypoints.xy[0]

Then:

nose = keypoints[0]
left_shoulder = keypoints[5]
right_shoulder = keypoints[6]
left_wrist = keypoints[9]
right_wrist = keypoints[10]

Using the correct index is essential.

If index 9 is incorrectly interpreted as an ankle rather than the left wrist, downstream pose analysis will also be incorrect.

Skeleton Connections Between Keypoints

A skeleton is produced by connecting related landmarks.

For example:

Left Shoulder → Left Elbow → Left Wrist
Right Shoulder → Right Elbow → Right Wrist
Left Hip → Left Knee → Left Ankle
Right Hip → Right Knee → Right Ankle

These connections make the predicted pose easier to visualize.

The pose model predicts the landmark coordinates themselves. The skeleton representation is then drawn by connecting predefined landmark pairs.

How to Access YOLOv8 Pose Results

Ultralytics provides a structured Python API for reading pose predictions.

A basic inference example is:

from ultralytics import YOLO

model = YOLO("yolov8n-pose.pt")
results = model("person.jpg")

result = results[0]

From this result, bounding box and pose information can be accessed separately.

Accessing Bounding Boxes

Bounding boxes can be accessed with:

boxes = result.boxes

For pixel coordinates:

xyxy = result.boxes.xyxy

For class IDs:

classes = result.boxes.cls

For detection confidence:

confidence = result.boxes.conf

The Boxes structure is part of the standard Ultralytics Results API.

Accessing Keypoints in Python

Keypoint coordinates can be accessed with:

keypoints = result.keypoints.xy

For normalized coordinates:

normalized_keypoints = result.keypoints.xyn

For example:

for person in result.keypoints.xy:
    for index, point in enumerate(person):
        x, y = point
        print(index, x.item(), y.item())

This allows each detected person’s landmarks to be processed independently.

Extracting Keypoint Confidence Values

You can access keypoint confidence with:

confidence = result.keypoints.conf

A practical example is:

for result in results:
    xy = result.keypoints.xy
    conf = result.keypoints.conf

    if conf is not None:
        for person_id in range(len(xy)):
            for keypoint_id in range(len(xy[person_id])):
                x, y = xy[person_id][keypoint_id]
                score = conf[person_id][keypoint_id]

                print(person_id, keypoint_id, x, y, score)

These confidence values can be useful when an application should ignore unreliable landmarks.

YOLOv8 Pose Output for Images and Videos

YOLOv8 Pose can process both static images and sequential video frames.

The basic output structure remains similar, but video produces predictions repeatedly as each frame is processed.

Pose Results for a Single Person

If only one person is detected, the result may contain:

1 bounding box
1 class prediction
1 detection confidence
17 human keypoints
17 corresponding keypoint confidence values

The keypoints belong to the detected person represented by the corresponding result entry.

Pose Results for Multiple People

If several people appear in the same image, the model can return pose information for multiple detected instances.

Conceptually:

Person 1
  Bounding box
  17 keypoints

Person 2
  Bounding box
  17 keypoints

Person 3
  Bounding box
  17 keypoints

This allows each person’s pose to be analyzed separately.

Care should be taken to preserve the relationship between each bounding box and its corresponding keypoint set.

Frame-by-Frame Video Pose Output

For video input, YOLOv8 processes frames and generates pose predictions for each frame.

A typical workflow may look like:

results = model("video.mp4", stream=True)

for result in results:
    boxes = result.boxes
    keypoints = result.keypoints

Streaming results can be useful for longer videos because frames can be processed sequentially rather than keeping every result in memory simultaneously. Ultralytics Predict mode supports video and streaming workflows.

Using Custom Keypoints in YOLOv8 Pose

YOLOv8 Pose is not limited to the 17 human COCO landmarks.

Custom pose datasets can define different landmark layouts and different numbers of keypoints.

Defining a Custom Keypoint Layout

Suppose you want to detect four landmarks on a custom object:

0 = top_left
1 = top_right
2 = bottom_left
3 = bottom_right

Your dataset configuration can define a keypoint shape such as:

kpt_shape: [4, 3]

This tells the pose training pipeline that every annotated object contains four keypoints, each represented by three values in the configured label structure.

Custom Dataset Output Format

After training a custom pose model, predictions follow the keypoint structure learned from that dataset.

A four-keypoint model produces four landmarks for each detected instance rather than the 17 landmarks used by COCO human pose.

For example:

result.keypoints.xy

might conceptually have a shape like:

[number_of_objects, 4, 2]

for x and y coordinate access.

The application must interpret each keypoint according to the ordering defined during dataset creation.

Changing the Number of Keypoints

The number of keypoints is determined during model training from the dataset configuration.

You cannot simply change a trained 17-keypoint model into a 10-keypoint model during inference.

To use a different landmark structure, prepare a dataset with the desired keypoint definition and train or fine-tune an appropriate pose model.

Ultralytics pose datasets demonstrate that different tasks can use different keypoint counts, including the standard 17-point human layout and 21-point hand layout.

Common Issues with YOLOv8 Pose Output

Pose output problems often come from difficult images, incorrect dataset annotations, or confusion about coordinate and keypoint formats.

Missing or Low-Confidence Keypoints

Some keypoints may be difficult to predict when they are:

  • occluded,
  • outside the image,
  • extremely small,
  • motion blurred,
  • poorly illuminated,
  • visually ambiguous.

Low-confidence landmarks should usually be handled carefully rather than treated as equally reliable.

For example:

if keypoint_confidence > 0.5:
    # use keypoint

The correct confidence threshold depends on the application.

Incorrect Keypoint Coordinates

If coordinates appear incorrect, check whether your code expects pixel or normalized coordinates.

Do not treat:

result.keypoints.xyn

as pixel positions.

Likewise, do not assume:

result.keypoints.xy

contains values between 0 and 1.

Also verify that image resizing or custom preprocessing has not changed the coordinate system used by downstream code.

Mismatched Keypoint Shapes

Custom pose datasets can fail or produce incorrect results if the configured keypoint shape does not match the labels.

For example, if:

kpt_shape: [8, 3]

is configured, every labeled object must follow the expected eight-keypoint structure.

A mismatch between annotation ordering, number of keypoints, or dimensionality can cause training problems and make the resulting pose output difficult to interpret.

FAQs About YOLOv8 Pose Keypoints and Output Format

How many keypoints does YOLOv8 Pose detect?

The standard YOLOv8 human pose model trained using the COCO Pose keypoint structure predicts 17 keypoints per detected person. Custom pose models can use a different number of landmarks.

What is the YOLOv8 Pose output format?

YOLOv8 Pose outputs object detection information together with pose landmarks. Processed results can contain bounding boxes, class IDs, detection confidence scores, keypoint coordinates, and keypoint confidence values.

Ultralytics exposes these through result.boxes and result.keypoints.

Does YOLOv8 Pose return keypoint confidence scores?

Yes. When confidence values are present, they can be accessed through:

result.keypoints.conf

These scores describe the confidence associated with individual predicted keypoints.

What do the 17 YOLOv8 Pose keypoints represent?

They represent the nose, left and right eyes, ears, shoulders, elbows, wrists, hips, knees, and ankles according to the COCO human pose keypoint layout.

Are YOLOv8 Pose coordinates normalized?

Both formats are available in the processed result API.

Use:

result.keypoints.xy

for image-space coordinates and:

result.keypoints.xyn

for normalized coordinates.

Can YOLOv8 Pose use custom keypoints?

Yes. Custom pose datasets can define their own number and ordering of keypoints through the dataset configuration. The model can then be trained to predict those custom landmarks instead of the standard COCO human keypoints.

How do I extract YOLOv8 Pose keypoints in Python?

A basic example is:

from ultralytics import YOLO

model = YOLO("yolov8n-pose.pt")
results = model("image.jpg")

for result in results:
    xy = result.keypoints.xy
    conf = result.keypoints.conf

    print(xy)
    print(conf)

Use result.keypoints.xyn instead if normalized landmark coordinates are required.

Conclusion

YOLOv8 Pose keypoints and output format provide more detailed information than standard object detection. In addition to bounding boxes and object confidence, a pose model predicts landmark coordinates that describe the internal pose or structure of each detected instance.

Standard human pose models use the 17-keypoint COCO layout, covering facial landmarks and major upper- and lower-body joints.

Through the Ultralytics Results API, developers can access bounding boxes with result.boxes, pixel-space keypoints with result.keypoints.xy, normalized landmarks with result.keypoints.xyn, and keypoint confidence using result.keypoints.conf.

Custom pose models can also use completely different landmark definitions, making YOLOv8 Pose suitable for human movement analysis, animal pose estimation, hand landmarks, industrial objects, and other applications where specific spatial points need to be detected.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top