Link to this sectionCOCO-Pose 数据集#
COCO-Pose 数据集是 COCO (Common Objects in Context) 数据集的专门版本,专为姿态估计任务而设计。它利用 COCO Keypoints 2017 的图像和标签,使你能够训练 YOLO 等模型来执行姿态估计任务。

Link to this sectionCOCO-Pose 预训练模型#
| 模型 | 尺寸 (像素) | mAPpose 50-95(e2e) | mAPpose 50(e2e) | 速度 CPU ONNX (ms) | 速度 T4 TensorRT10 (ms) | 参数量 (M) | FLOPs (B) |
|---|---|---|---|---|---|---|---|
| YOLO26n-pose | 640 | 57.2 | 83.3 | 40.3 ± 0.5 | 1.8 ± 0.0 | 2.9 | 7.5 |
| YOLO26s-pose | 640 | 63.0 | 86.6 | 85.3 ± 0.9 | 2.7 ± 0.0 | 10.4 | 23.9 |
| YOLO26m-pose | 640 | 68.8 | 89.6 | 218.0 ± 1.5 | 5.0 ± 0.1 | 21.5 | 73.1 |
| YOLO26l-pose | 640 | 70.4 | 90.5 | 275.4 ± 2.4 | 6.5 ± 0.1 | 25.9 | 91.3 |
| YOLO26x-pose | 640 | 71.6 | 91.6 | 565.4 ± 3.0 | 12.2 ± 0.2 | 57.6 | 201.7 |
Link to this section主要特性#
- COCO-Pose 基于 COCO Keypoints 2017 数据集构建,该数据集包含 20 万张带有关键点标注的图像,用于姿态估计任务。
- 该数据集支持对人体图形进行 17 个关键点标注,有助于实现精细的姿态估计。
- 与 COCO 一样,它提供了标准化的评估指标,包括用于姿态估计任务的对象关键点相似度 (OKS),使其适合比较模型性能。
Link to this section数据集结构#
COCO-Pose 数据集被划分为三个子集:
- Train2017:该子集包含来自 COCO 数据集的 56599 张图像,并为训练姿态估计模型进行了标注。
- Val2017:该子集包含 2346 张图像,用于模型训练期间的验证。
- Test2017:此子集由用于测试和基准测试训练模型图像组成。此子集的基准标注不公开,结果需提交至 COCO evaluation server 进行性能评估。
Link to this section应用#
COCO-Pose 数据集专门用于训练和评估关键点检测和姿态估计任务(例如 OpenPose)中的 深度学习 模型。该数据集拥有大量标注图像和标准化评估指标,使其成为专注于姿态估计的 计算机视觉 研究人员和从业者的重要资源。
Link to this section数据集 YAML#
YAML (Yet Another Markup Language) 文件用于定义数据集配置。它包含有关数据集路径、类别和其他相关信息。对于 COCO-Pose 数据集,coco-pose.yaml 文件维护在 https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco-pose.yaml。
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# COCO 2017 Keypoints dataset https://cocodataset.org by Microsoft
# Documentation: https://docs.ultralytics.com/datasets/pose/coco/
# Example usage: yolo train data=coco-pose.yaml
# parent
# ├── ultralytics
# └── datasets
# └── coco-pose ← downloads here (20.1 GB)
# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
path: coco-pose # dataset root dir
train: train2017.txt # train images (relative to 'path') 56599 images
val: val2017.txt # val images (relative to 'path') 2346 images
test: test-dev2017.txt # 20288 of 40670 images, submit to https://codalab.lisn.upsaclay.fr/competitions/7403
# Keypoints
kpt_shape: [17, 3] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible)
flip_idx: [0, 2, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 16, 15]
# Classes
names:
0: person
# Keypoint names per class
kpt_names:
0:
- nose
- left_eye
- right_eye
- left_ear
- right_ear
- left_shoulder
- right_shoulder
- left_elbow
- right_elbow
- left_wrist
- right_wrist
- left_hip
- right_hip
- left_knee
- right_knee
- left_ankle
- right_ankle
# Download script/URL (optional)
download: |
from pathlib import Path
from ultralytics.utils import ASSETS_URL
from ultralytics.utils.downloads import download
# Download labels
dir = Path(yaml["path"]) # dataset root dir
urls = [f"{ASSETS_URL}/coco2017labels-pose.zip"]
download(urls, dir=dir.parent)
# Download data
urls = [
"http://images.cocodataset.org/zips/train2017.zip", # 19G, 118k images
"http://images.cocodataset.org/zips/val2017.zip", # 1G, 5k images
"http://images.cocodataset.org/zips/test2017.zip", # 7G, 41k images (optional)
]
download(urls, dir=dir / "images", threads=3)Link to this section用法#
要在 COCO-Pose 数据集上训练 YOLO26n-pose 模型 100 个 轮次,且图像大小为 640,你可以使用以下代码片段。有关可用参数的完整列表,请参阅模型 训练 页面。
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n-pose.pt") # load a pretrained model (recommended for training)
# Train the model
results = model.train(data="coco-pose.yaml", epochs=100, imgsz=640)Link to this section样本图像和标注#
COCO-Pose 数据集包含一组多样化的图像,其中的人体图形带有关键点标注。以下是该数据集中的一些图像及其对应标注的示例:

- 马赛克图像:此图像展示了一个由马赛克数据集图像组成的训练批次。马赛克是一种在训练期间使用的技术,它将多张图像合并为单张图像,以增加每个训练批次中物体和场景的多样性。这有助于提高模型对不同物体尺寸、宽高比和上下文的泛化能力。
该示例展示了 COCO-Pose 数据集中图像的多样性和复杂性,以及在训练过程中使用马赛克增强的优势。
Link to this section引用与致谢#
如果你在研究或开发工作中使用了 COCO-Pose 数据集,请引用以下论文:
@misc{lin2015microsoft,
title={Microsoft COCO: Common Objects in Context},
author={Tsung-Yi Lin and Michael Maire and Serge Belongie and Lubomir Bourdev and Ross Girshick and James Hays and Pietro Perona and Deva Ramanan and C. Lawrence Zitnick and Piotr Dollár},
year={2015},
eprint={1405.0312},
archivePrefix={arXiv},
primaryClass={cs.CV}
}我们感谢 COCO 联盟为计算机视觉社区创建并维护这一宝贵资源。有关 COCO-Pose 数据集及其创建者的更多信息,请访问 COCO 数据集网站。
Link to this section常见问题解答#
Link to this section什么是 COCO-Pose 数据集,以及它如何与 Ultralytics YOLO 一起用于姿态估计?#
COCO-Pose 数据集是 COCO (Common Objects in Context) 数据集的专门版本,专为姿态估计任务而设计。它基于 COCO Keypoints 2017 的图像和标注构建,允许训练 Ultralytics YOLO 等模型进行精细的姿态估计。例如,你可以通过加载预训练模型并使用 YAML 配置进行训练,在 COCO-Pose 数据集上训练 YOLO26n-pose 模型。有关训练示例,请参阅 训练 文档。
Link to this section我该如何在 COCO-Pose 数据集上训练 YOLO26 模型?#
在 COCO-Pose 数据集上训练 YOLO26 模型可以使用 Python 或 CLI 命令完成。例如,要以 640 的图像大小训练 YOLO26n-pose 模型 100 个轮次,你可以按照以下步骤操作:
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n-pose.pt") # load a pretrained model (recommended for training)
# Train the model
results = model.train(data="coco-pose.yaml", epochs=100, imgsz=640)有关训练过程和可用参数的更多详细信息,请查看 训练页面。
Link to this sectionCOCO-Pose 数据集提供哪些不同的指标来评估模型性能?#
COCO-Pose 数据集为姿态估计任务提供了几种标准化的评估指标,类似于原始的 COCO 数据集。关键指标包括对象关键点相似度 (OKS),它评估预测的关键点与真实标注之间的 准确率。这些指标允许在不同模型之间进行全面的性能比较。例如,COCO-Pose 预训练模型(如 YOLO26n-pose、YOLO26s-pose 等)在文档中列出了具体的性能指标,如 mAPpose50-95 和 mAPpose50。
Link to this sectionCOCO-Pose 数据集的结构和划分是怎样的?#
COCO-Pose 数据集被划分为三个子集:
- Train2017:包含 56599 张 COCO 图像,并为训练姿态估计模型进行了标注。
- Val2017:2346 张图像,用于模型训练期间的验证。
- Test2017:用于测试和基准测试训练模型的图像。此子集的基准标注不公开;结果需提交至 COCO evaluation server 进行性能评估。
These subsets help organize the training, validation, and testing phases effectively. For configuration details, explore the coco-pose.yaml file available on GitHub.
Link to this sectionCOCO-Pose 数据集的主要功能和应用是什么?#
COCO-Pose 数据集扩展了 COCO Keypoints 2017 的标注,包含 17 个关键点的人体图形,从而实现精细的姿态估计。标准化评估指标(例如 OKS)有助于在不同模型之间进行比较。COCO-Pose 数据集的应用跨越了各个领域,如体育分析、医疗保健和人机交互,凡是需要对人体图形进行详细姿态估计的场合均可应用。对于实际使用,利用文档中提供的预训练模型(例如 YOLO26n-pose)可以显著简化流程 (主要功能)。
如果你在研究或开发工作中使用了 COCO-Pose 数据集,请引用带有以下 BibTeX 条目 的论文。