COCO-Seg 数据集
COCO-Seg 数据集是 COCO(上下文中的常见对象)数据集的扩展,专门设计用于辅助对象实例分割的研究。它使用与COCO相同的图像,但引入了更详细的分割标注。该数据集是从事实例分割任务的研究人员和开发人员的重要资源,特别是用于训练YOLO模型。
COCO-Seg 预训练模型
| 模型 | 尺寸 (像素) |
mAP框 50-95 |
mAP掩码 50-95 |
速度 CPU ONNX (毫秒) |
速度 T4 TensorRT10 (毫秒) |
参数 (M) |
FLOPs (B) |
|---|---|---|---|---|---|---|---|
| YOLO11n-seg | 640 | 38.9 | 32.0 | 65.9 ± 1.1 | 1.8 ± 0.0 | 2.9 | 10.4 |
| YOLO11s-seg | 640 | 46.6 | 37.8 | 117.6 ± 4.9 | 2.9 ± 0.0 | 10.1 | 35.5 |
| YOLO11m-seg | 640 | 51.5 | 41.5 | 281.6 ± 1.2 | 6.3 ± 0.1 | 22.4 | 123.3 |
| YOLO11l-seg | 640 | 53.4 | 42.9 | 344.2 ± 3.2 | 7.8 ± 0.2 | 27.6 | 142.2 |
| YOLO11x-seg | 640 | 54.7 | 43.8 | 664.5 ± 3.2 | 15.8 ± 0.7 | 62.1 | 319.0 |
关键特性
- COCO-Seg保留了COCO原有的33万张图像。
- 数据集包含与原始COCO数据集中相同的80个对象类别。
- 标注现在包括图像中每个对象的更详细的实例分割掩码。
- COCO-Seg提供了标准化的评估指标,如平均精度均值(mAP)用于目标检测,以及实例分割任务的平均召回率均值(mAR),使模型性能的有效比较成为可能。
数据集结构
COCO-Seg数据集分为三个子集:
- Train2017:该子集包含11.8万张图像,用于训练实例分割模型。
- Val2017:该子集包括5千张图像,用于模型训练期间的验证。
- Test2017:该子集包含2万张图像,用于测试和基准测试训练好的模型。该子集的地面真实标注不公开,结果提交到COCO评估服务器进行性能评估。
应用
COCO-Seg广泛用于训练和评估深度学习模型在实例分割中的应用,如YOLO模型。大量标注图像、对象类别的多样性以及标准化的评估指标使其成为计算机视觉研究人员和从业者的不可或缺的资源。
数据集YAML
YAML(另一种标记语言)文件用于定义数据集配置。它包含有关数据集路径、类别和其他相关信息的信息。对于COCO-Seg数据集,coco.yaml文件保存在https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco.yaml。
ultralytics/cfg/datasets/coco.yaml
# Ultralytics YOLO 🚀, AGPL-3.0 license
# COCO 2017 dataset https://cocodataset.org by Microsoft
# Documentation: https://docs.ultralytics.com/datasets/detect/coco/
# Example usage: yolo train data=coco.yaml
# parent
# ├── ultralytics
# └── datasets
# └── coco ← 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: ../datasets/coco # dataset root dir
train: train2017.txt # train images (relative to 'path') 118287 images
val: val2017.txt # val images (relative to 'path') 5000 images
test: test-dev2017.txt # 20288 of 40670 images, submit to https://competitions.codalab.org/competitions/20794
# Classes
names:
0: person
1: bicycle
2: car
3: motorcycle
4: airplane
5: bus
6: train
7: truck
8: boat
9: traffic light
10: fire hydrant
11: stop sign
12: parking meter
13: bench
14: bird
15: cat
16: dog
17: horse
18: sheep
19: cow
20: elephant
21: bear
22: zebra
23: giraffe
24: backpack
25: umbrella
26: handbag
27: tie
28: suitcase
29: frisbee
30: skis
31: snowboard
32: sports ball
33: kite
34: baseball bat
35: baseball glove
36: skateboard
37: surfboard
38: tennis racket
39: bottle
40: wine glass
41: cup
42: fork
43: knife
44: spoon
45: bowl
46: banana
47: apple
48: sandwich
49: orange
50: broccoli
51: carrot
52: hot dog
53: pizza
54: donut
55: cake
56: chair
57: couch
58: potted plant
59: bed
60: dining table
61: toilet
62: tv
63: laptop
64: mouse
65: remote
66: keyboard
67: cell phone
68: microwave
69: oven
70: toaster
71: sink
72: refrigerator
73: book
74: clock
75: vase
76: scissors
77: teddy bear
78: hair drier
79: toothbrush
# Download script/URL (optional)
download: |
from ultralytics.utils.downloads import download
from pathlib import Path
# Download labels
segments = True # segment or box labels
dir = Path(yaml['path']) # dataset root dir
url = 'https://github.com/ultralytics/assets/releases/download/v0.0.0/'
urls = [url + ('coco2017labels-segments.zip' if segments else 'coco2017labels.zip')] # labels
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)
使用方法
要在COCO-Seg数据集上训练一个YOLO11n-seg模型,进行100个epoch,图像大小为640,可以使用以下代码片段。有关可用参数的完整列表,请参阅模型训练页面。
训练示例
示例图像和标注
COCO-Seg,像其前身COCO一样,包含各种对象类别和复杂场景的多样化图像。然而,COCO-Seg为图像中的每个对象引入了更详细的实例分割掩码。以下是数据集中的一些图像示例及其相应的实例分割掩码:

- 马赛克图像:此图像展示了一个由马赛克数据集图像组成的训练批次。马赛克是一种在训练期间使用的技术,将多张图像组合成一张图像,以增加每个训练批次中对象和场景的多样性。这有助于模型对不同对象大小、宽高比和上下文进行泛化。
该示例展示了COCO-Seg数据集中图像的多样性和复杂性,以及在训练过程中使用马赛克的好处。
引用和致谢
如果你在研究或开发工作中使用了COCO-Seg数据集,请引用原始的COCO论文并承认对COCO-Seg的扩展:
@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数据集及其创建者的更多信息,请访问COCO数据集网站。
常见问题
什么是COCO-Seg数据集,它与原始COCO数据集有何不同?
COCO-Seg数据集是原始COCO(上下文中的常见对象)数据集的扩展,专门设计用于实例分割任务。虽然它使用与COCO数据集相同的图像,但COCO-Seg包含了更详细的分割标注,使其成为专注于对象实例分割的研究人员和开发者的强大资源。
如何使用COCO-Seg数据集训练YOLO11模型?
要使用COCO-Seg数据集训练YOLO11n-seg模型100个周期,图像大小为640,可以使用以下代码片段。有关可用参数的详细列表,请参阅模型训练页面。
训练示例
COCO-Seg数据集的关键特性是什么?
COCO-Seg数据集包含以下几个关键特性:
- 保留了COCO数据集中的原始33万张图像。
- 标注了与原始COCO中相同的80个对象类别。
- 为每个对象提供了更详细的实例分割掩码。
- 使用标准化的评估指标,如平均精度(mAP)用于目标检测和平均召回率(mAR)用于实例分割任务。
有哪些预训练模型可用于COCO-Seg,它们的性能指标是什么?
COCO-Seg数据集支持多个具有不同性能指标的预训练YOLO11分割模型。以下是可用模型及其关键指标的总结:
| 模型 | 尺寸 (像素) |
mAP框 50-95 |
mAP掩码 50-95 |
速度 CPU ONNX (毫秒) |
速度 T4 TensorRT10 (毫秒) |
参数 (M) |
FLOPs (B) |
|---|---|---|---|---|---|---|---|
| YOLO11n-seg | 640 | 38.9 | 32.0 | 65.9 ± 1.1 | 1.8 ± 0.0 | 2.9 | 10.4 |
| YOLO11s-seg | 640 | 46.6 | 37.8 | 117.6 ± 4.9 | 2.9 ± 0.0 | 10.1 | 35.5 |
| YOLO11m-seg | 640 | 51.5 | 41.5 | 281.6 ± 1.2 | 6.3 ± 0.1 | 22.4 | 123.3 |
| YOLO11l-seg | 640 | 53.4 | 42.9 | 344.2 ± 3.2 | 7.8 ± 0.2 | 27.6 | 142.2 |
| YOLO11x-seg | 640 | 54.7 | 43.8 | 664.5 ± 3.2 | 15.8 ± 0.7 | 62.1 | 319.0 |
COCO-Seg数据集的结构如何,它包含哪些子集?
COCO-Seg数据集根据特定的训练和评估需求划分为三个子集:
- Train2017:包含11.8万张图像,主要用于训练实例分割模型。
- Val2017:包含5千张图像,用于训练过程中的验证。
- Test2017:包含2万张图像,用于测试和基准测试训练好的模型。请注意,此子集的地面真实标注不公开,性能结果需提交至COCO评估服务器进行评估。