COCO8
收藏魔搭社区2026-05-15 更新2026-05-03 收录
下载链接:
https://modelscope.cn/datasets/Ultralytics/COCO8
下载链接
链接失效反馈官方服务:
资源简介:
# COCO8 Dataset
## Introduction
[Ultralytics](https://www.ultralytics.com/) COCO8 is a small, but versatile [object detection](https://www.ultralytics.com/glossary/object-detection) dataset composed of the first 8 images of the COCO train 2017 set, 4 for training and 4 for validation. This dataset is ideal for testing and debugging object detection models, or for experimenting with new detection approaches. With 8 images, it is small enough to be easily manageable, yet diverse enough to test training pipelines for errors and act as a sanity check before training larger datasets.
This dataset is intended for use with Ultralytics [HUB](https://hub.ultralytics.com/) and [YOLO11](https://github.com/ultralytics/ultralytics).
## Dataset YAML
A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. In the case of the COCO8 dataset, the `coco8.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco8.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco8.yaml).
!!! example "ultralytics/cfg/datasets/coco8.yaml"
```yaml
--8<-- "ultralytics/cfg/datasets/coco8.yaml"
```
## Usage
To train a YOLO11n model on the COCO8 dataset for 100 [epochs](https://www.ultralytics.com/glossary/epoch) with an image size of 640, you can use the following code snippets. For a comprehensive list of available arguments, refer to the model [Training](../../modes/train.md) page.
!!! example "Train Example"
=== "Python"
```python
from ultralytics import YOLO
# Load a model
model = YOLO("yolo11n.pt") # load a pretrained model (recommended for training)
# Train the model
results = model.train(data="coco8.yaml", epochs=100, imgsz=640)
```
=== "CLI"
```bash
# Start training from a pretrained *.pt model
yolo detect train data=coco8.yaml model=yolo11n.pt epochs=100 imgsz=640
```
## Sample Images and Annotations
Here are some examples of images from the COCO8 dataset, along with their corresponding annotations:
<img src="https://github.com/ultralytics/docs/releases/download/0/mosaiced-training-batch-1.avif" alt="Dataset sample image" width="800">
- **Mosaiced Image**: This image demonstrates a training batch composed of mosaiced dataset images. Mosaicing is a technique used during training that combines multiple images into a single image to increase the variety of objects and scenes within each training batch. This helps improve the model's ability to generalize to different object sizes, aspect ratios, and contexts.
The example showcases the variety and complexity of the images in the COCO8 dataset and the benefits of using mosaicing during the training process.
## Citations and Acknowledgments
If you use the COCO dataset in your research or development work, please cite the following paper:
!!! quote ""
=== "BibTeX"
```bibtex
@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}
}
```
We would like to acknowledge the COCO Consortium for creating and maintaining this valuable resource for the [computer vision](https://www.ultralytics.com/glossary/computer-vision-cv) community. For more information about the COCO dataset and its creators, visit the [COCO dataset website](https://cocodataset.org/#home).
## FAQ
### What is the Ultralytics COCO8 dataset used for?
The Ultralytics COCO8 dataset is a compact yet versatile object detection dataset consisting of the first 8 images from the COCO train 2017 set, with 4 images for training and 4 for validation. It is designed for testing and debugging object detection models and experimentation with new detection approaches. Despite its small size, COCO8 offers enough diversity to act as a sanity check for your training pipelines before deploying larger datasets. For more details, view the [COCO8 dataset](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco8.yaml).
### How do I train a YOLO11 model using the COCO8 dataset?
To train a YOLO11 model using the COCO8 dataset, you can employ either Python or CLI commands. Here's how you can start:
!!! example "Train Example"
=== "Python"
```python
from ultralytics import YOLO
# Load a model
model = YOLO("yolo11n.pt") # load a pretrained model (recommended for training)
# Train the model
results = model.train(data="coco8.yaml", epochs=100, imgsz=640)
```
=== "CLI"
```bash
# Start training from a pretrained *.pt model
yolo detect train data=coco8.yaml model=yolo11n.pt epochs=100 imgsz=640
```
For a comprehensive list of available arguments, refer to the model [Training](../../modes/train.md) page.
### Why should I use Ultralytics HUB for managing my COCO8 training?
Ultralytics HUB is an all-in-one web tool designed to simplify the training and deployment of YOLO models, including the Ultralytics YOLO11 models on the COCO8 dataset. It offers cloud training, real-time tracking, and seamless dataset management. HUB allows you to start training with a single click and avoids the complexities of manual setups. Discover more about [Ultralytics HUB](https://hub.ultralytics.com/) and its benefits.
### What are the benefits of using mosaic augmentation in training with the COCO8 dataset?
Mosaic augmentation, demonstrated in the COCO8 dataset, combines multiple images into a single image during training. This technique increases the variety of objects and scenes in each training batch, improving the model's ability to generalize across different object sizes, aspect ratios, and contexts. This results in a more robust object detection model. For more details, refer to the [training guide](#usage).
### How can I validate my YOLO11 model trained on the COCO8 dataset?
Validation of your YOLO11 model trained on the COCO8 dataset can be performed using the model's validation commands. You can invoke the validation mode via CLI or Python script to evaluate the model's performance using precise metrics. For detailed instructions, visit the [Validation](../../modes/val.md) page.
# COCO8 数据集
## 简介
[Ultralytics](https://www.ultralytics.com/) COCO8 是一款小巧但通用的目标检测(object detection)数据集,由 COCO 2017 训练集的前 8 张图像组成,其中 4 张用于训练,4 张用于验证。该数据集非常适合测试与调试目标检测模型,或试验新型检测方法。由于仅包含 8 张图像,它体量小巧、易于管理,同时又具备足够的多样性,可用于测试训练流程中的潜在错误,并在训练更大规模数据集前作为合理性验证环节。
本数据集专为 Ultralytics [HUB](https://hub.ultralytics.com/) 与 [YOLO11](https://github.com/ultralytics/ultralytics) 设计使用。
## 数据集 YAML
我们使用 YAML(另一种标记语言,Yet Another Markup Language)文件定义数据集配置,其中包含数据集路径、类别及其他相关信息。COCO8 数据集的 `coco8.yaml` 文件维护于 [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco8.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco8.yaml)。
!!! example "ultralytics/cfg/datasets/coco8.yaml"
yaml
--8<-- "ultralytics/cfg/datasets/coco8.yaml"
## 使用方法
若要在 COCO8 数据集上训练 YOLO11n 模型,共 100 个训练轮次(epoch),图像尺寸设为 640,可使用以下代码片段。有关可用参数的完整列表,请参阅模型[训练](../../modes/train.md)页面。
!!! example "训练示例"
=== "Python"
python
from ultralytics import YOLO
# 加载模型
model = YOLO("yolo11n.pt") # 加载预训练模型(推荐用于训练)
# 训练模型
results = model.train(data="coco8.yaml", epochs=100, imgsz=640)
=== "CLI"
bash
# 从预训练的 *.pt 模型开始训练
yolo detect train data=coco8.yaml model=yolo11n.pt epochs=100 imgsz=640
## 示例图像与标注
以下为 COCO8 数据集中的部分图像示例及其对应标注:
<img src="https://github.com/ultralytics/docs/releases/download/0/mosaiced-training-batch-1.avif" alt="Dataset sample image" width="800">
- **拼接图像(Mosaiced Image)**:该图像展示了由多张拼接后的数据集图像组成的训练批次。拼接是一种训练阶段常用的技术,将多张图像合并为单张图像,以增加每个训练批次中对象与场景的多样性,有助于提升模型对不同对象尺寸、宽高比及场景上下文的泛化能力。
本示例展示了 COCO8 数据集中图像的多样性与复杂性,以及训练过程中使用拼接数据增强的优势。
## 引用与致谢
若您在研究或开发工作中使用 COCO 数据集,请引用以下论文:
!!! quote ""
=== "BibTeX"
bibtex
@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 联盟为计算机视觉(computer vision, CV)社区创建并维护这一宝贵资源。有关 COCO 数据集及其创作者的更多信息,请访问[COCO 数据集官网](https://cocodataset.org/#home)。
## 常见问题
### Ultralytics COCO8 数据集的用途是什么?
Ultralytics COCO8 是一款紧凑且通用的目标检测数据集,由 COCO 2017 训练集的前 8 张图像组成,其中 4 张用于训练,4 张用于验证。其设计初衷为测试与调试目标检测模型,以及试验新型检测方法。尽管体量小巧,COCO8 仍具备足够的多样性,可在部署更大规模数据集前,作为训练流程的合理性验证环节。有关更多细节,请查看[COCO8 数据集](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco8.yaml)。
### 如何使用 COCO8 数据集训练 YOLO11 模型?
若要使用 COCO8 数据集训练 YOLO11 模型,可采用 Python 或 CLI 命令,操作方式如下:
!!! example "训练示例"
=== "Python"
python
from ultralytics import YOLO
# 加载模型
model = YOLO("yolo11n.pt") # 加载预训练模型(推荐用于训练)
# 训练模型
results = model.train(data="coco8.yaml", epochs=100, imgsz=640)
=== "CLI"
bash
# 从预训练的 *.pt 模型开始训练
yolo detect train data=coco8.yaml model=yolo11n.pt epochs=100 imgsz=640
有关可用参数的完整列表,请参阅模型[训练](../../modes/train.md)页面。
### 为什么我应该使用 Ultralytics HUB 管理 COCO8 训练任务?
Ultralytics HUB 是一款一体化 Web 工具,旨在简化 YOLO 模型(包括基于 COCO8 数据集的 Ultralytics YOLO11 模型)的训练与部署。它提供云端训练、实时跟踪与无缝数据集管理功能,支持一键启动训练,规避手动配置的复杂性。了解更多关于[Ultralytics HUB](https://hub.ultralytics.com/)及其优势的信息。
### 使用 COCO8 数据集进行训练时,采用拼接数据增强有哪些好处?
如 COCO8 数据集中展示的拼接数据增强,是指在训练阶段将多张图像合并为单张图像的技术。该方法可增加每个训练批次中对象与场景的多样性,提升模型对不同对象尺寸、宽高比及场景上下文的泛化能力,最终得到鲁棒性更强的目标检测模型。有关更多细节,请参阅[训练指南](#usage)。
### 如何验证基于 COCO8 数据集训练的 YOLO11 模型?
可通过模型的验证命令对基于 COCO8 数据集训练的 YOLO11 模型进行验证。您可以通过 CLI 或 Python 脚本启动验证模式,使用精准的指标评估模型性能。有关详细说明,请访问[验证](../../modes/val.md)页面。
提供机构:
maas
创建时间:
2026-02-02



