Link to this sectionCOCO データセット#
COCO (Common Objects in Context) データセットは、大規模な物体検出、セグメンテーション、キャプション生成用データセットです。多種多様な物体カテゴリの研究を促進するために設計されており、コンピュータビジョンモデルのベンチマークによく使用されます。物体検出、セグメンテーション、姿勢推定タスクに取り組む研究者や開発者にとって不可欠なデータセットです。
Watch: Ultralytics COCO Dataset Overview
Link to this sectionCOCO 学習済みモデル#
| モデル | サイズ (ピクセル) | mAPval 50-95 | mAPval 50-95(e2e) | 速度 CPU ONNX (ms) | 速度 T4 TensorRT10 (ms) | パラメータ (M) | FLOPs (B) |
|---|---|---|---|---|---|---|---|
| YOLO26n | 640 | 40.9 | 40.1 | 38.9 ± 0.7 | 1.7 ± 0.0 | 2.4 | 5.4 |
| YOLO26s | 640 | 48.6 | 47.8 | 87.2 ± 0.9 | 2.5 ± 0.0 | 9.5 | 20.7 |
| YOLO26m | 640 | 53.1 | 52.5 | 220.0 ± 1.4 | 4.7 ± 0.1 | 20.4 | 68.2 |
| YOLO26l | 640 | 55.0 | 54.4 | 286.2 ± 2.0 | 6.2 ± 0.2 | 24.8 | 86.4 |
| YOLO26x | 640 | 57.5 | 56.9 | 525.8 ± 4.0 | 11.8 ± 0.2 | 55.7 | 193.9 |
Link to this section主な特徴#
- COCO には33万枚の画像が含まれており、そのうち20万枚には物体検出、セグメンテーション、キャプション生成タスク用のアノテーションが付与されています。
- このデータセットは80の物体カテゴリで構成されており、自動車、自転車、動物といった一般的な物体のほか、傘、ハンドバッグ、スポーツ用品といったより特定のカテゴリも含まれています。
- アノテーションには、各画像に対する物体バウンディングボックス、セグメンテーションマスク、キャプションが含まれます。
- COCO は物体検出用の mean Average Precision (mAP) や、セグメンテーションタスク用の mean Average Recall (mAR) といった標準化された評価指標を提供しており、モデルのパフォーマンス比較に適しています。
Link to this sectionデータセットの構造#
COCO データセットは3つのサブセットに分割されています:
- Train2017: このサブセットには、物体検出、セグメンテーション、キャプション生成モデルを学習するための11.8万枚の画像が含まれています。
- Val2017: このサブセットには、モデル学習中の検証用として使用される5000枚の画像が含まれています。
- Test2017: このサブセットは、トレーニング済みモデルのテストとベンチマークに使用される2万枚の画像で構成されています。このサブセットの正解アノテーションは公開されておらず、結果はパフォーマンス評価のために COCO evaluation server に送信されます。
Link to this sectionアプリケーション#
The COCO dataset is widely used for training and evaluating deep learning models in object detection (such as Ultralytics YOLO, Faster R-CNN, and SSD), instance segmentation (such as Mask R-CNN), and keypoint detection (such as OpenPose). The dataset's diverse set of object categories, large number of annotated images, and standardized evaluation metrics make it an essential resource for computer vision researchers and practitioners.
Link to this sectionデータセット YAML#
YAML(Yet Another Markup Language)ファイルは、データセットの構成を定義するために使用されます。これには、データセットのパス、クラス、およびその他の関連情報が含まれます。COCO データセットの場合、coco.yaml ファイルは https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco.yaml に管理されています。
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/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: 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 via https://cocodataset.org/#detection-eval
# 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 pathlib import Path
from ultralytics.utils import ASSETS_URL
from ultralytics.utils.downloads import download
# Download labels
segments = True # segment or box labels
dir = Path(yaml["path"]) # dataset root dir
urls = [ASSETS_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)Link to this section使用方法#
COCO データセットで YOLO26n モデルを画像サイズ640で100 エポック 学習させるには、以下のコードスニペットを使用できます。利用可能な引数の包括的なリストについては、モデルの トレーニング ページを参照してください。
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n.pt") # load a pretrained model (recommended for training)
# Train the model
results = model.train(data="coco.yaml", epochs=100, imgsz=640)Link to this sectionサンプル画像とアノテーション#
COCO データセットには、多様な物体カテゴリと複雑なシーンを持つ画像セットが含まれています。データセットに含まれる画像と、それに対応するアノテーションの例をいくつか示します:

- モザイク画像: この画像は、モザイク処理されたデータセット画像で構成されるトレーニングバッチを示しています。モザイク処理は、トレーニング中に複数の画像を1つの画像に結合し、各トレーニングバッチ内のオブジェクトやシーンの多様性を高める技術です。これにより、さまざまなオブジェクトのサイズ、アスペクト比、およびコンテキストに対してモデルが汎化する能力を向上させます。
この例は、COCO データセットの画像の多様性と複雑さ、および学習プロセス中にモザイク処理を使用する利点を示しています。
Link to this section引用と謝辞#
研究や開発作業で COCO データセットを使用する場合は、以下の論文を引用してください:
@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 データセットのウェブサイトをご覧ください。
Link to this sectionよくある質問 (FAQ)#
Link to this sectionCOCO データセットとは何か、なぜコンピュータビジョンにおいて重要なのか?#
COCO データセット (Common Objects in Context) は、物体検出、セグメンテーション、キャプション生成に使用される大規模なデータセットです。80の物体カテゴリに対する詳細なアノテーションが付与された33万枚の画像が含まれており、コンピュータビジョンモデルのベンチマークや学習に不可欠です。研究者は、その多様なカテゴリと mean Average Precision (mAP) といった標準化された評価指標のために COCO を利用しています。
Link to this sectionCOCO データセットを使用して YOLO モデルを学習させるにはどうすればよいか?#
COCO データセットを使用して YOLO26 モデルを学習させるには、以下のコードスニペットを使用できます:
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n.pt") # load a pretrained model (recommended for training)
# Train the model
results = model.train(data="coco.yaml", epochs=100, imgsz=640)利用可能な引数の詳細については、トレーニングページを参照してください。
Link to this sectionCOCO データセットの主な特徴は何か?#
COCO データセットには以下が含まれます:
- 33万枚の画像(うち20万枚に物体検出、セグメンテーション、キャプション生成のアノテーション済み)。
- 自動車や動物のような一般的なものから、ハンドバッグやスポーツ用品のような特定のものまで、80の物体カテゴリ。
- 物体検出 (mAP) およびセグメンテーション (mean Average Recall, mAR) 用の標準化された評価指標。
- さまざまな物体のサイズやコンテキストに対するモデルの汎化能力を向上させるための、学習バッチにおけるモザイク処理技術。
Link to this sectionCOCO データセットで学習された YOLO26 の学習済みモデルはどこで入手できるか?#
COCO データセットで学習された YOLO26 の学習済みモデルは、ドキュメントに記載されているリンクからダウンロードできます。例を以下に示します:
これらのモデルはサイズ、mAP、推論速度が異なり、さまざまなパフォーマンスやリソース要件に対応する選択肢を提供します。
Link to this sectionCOCO データセットはどのように構成されており、どのように使用するのか?#
COCO データセットは3つのサブセットに分割されています:
- Train2017: 学習用として11.8万枚の画像。
- Val2017: 学習中の検証用として5000枚の画像。
- Test2017: トレーニング済みモデルのベンチマーク用2万枚の画像。パフォーマンス評価のため、結果を COCO evaluation server に送信する必要があります。
データセットの YAML 構成ファイルは coco.yaml から入手可能で、パス、クラス、データセットの詳細が定義されています。