Datasets:
pretty_name: COCO2017
annotations_creators:
- expert-generated
size_categories:
- 100K<n<1M
language:
- en
task_categories:
- object-detection
Dataset Card for Dataset Name
This dataset includes COCO 2017 only.
COCO 2014 and 2015 will be included soon.
Dataset Description
- Homepage: https://cocodataset.org/
- Repository: https://github.com/cocodataset/cocoapi
- Paper: Microsoft COCO: Common Objects in Context
Dataset Summary
COCO (Common Objects in Context) is a large-scale object detection, segmentation, and captioning dataset. It contains over 200,000 labeled images with over 80 category labels. It includes complex, everyday scenes with common objects in their natural context.
This dataset covers only the "object detection" part of the COCO dataset. But some features and specifications for the full COCO dataset:
- Object segmentation
- Recognition in context
- Superpixel stuff segmentation
- 330K images (>200K labeled)
- 1.5 million object instances
- 80 object categories
- 91 stuff categories
- 5 captions per image
- 250,000 people with keypoints
Data Splits
Training set ("train"): 118287 images annotated with 860001 bounding boxes in total.
Validation set ("val"): 5000 images annotated with 36781 bounding boxes in total.
92 classes: "None", "person", "bicycle", "car", "motorcycle", "airplane", "bus", "train", "truck", "boat", "traffic light", "fire hydrant", "street sign", "stop sign", "parking meter", "bench", "bird", "cat", "dog", "horse", "sheep", "cow", "elephant", "bear", "zebra", "giraffe", "hat", "backpack", "umbrella", "shoe", "eye glasses", "handbag", "tie", "suitcase", "frisbee", "skis", "snowboard", "sports ball", "kite", "baseball bat", "baseball glove", "skateboard", "surfboard", "tennis racket", "bottle", "plate", "wine glass", "cup", "fork", "knife", "spoon", "bowl", "banana", "apple", "sandwich", "orange", "broccoli", "carrot", "hot dog", "pizza", "donut", "cake", "chair", "couch", "potted plant", "bed", "mirror", "dining table", "window", "desk", "toilet", "door", "tv", "laptop", "mouse", "remote", "keyboard", "cell phone", "microwave", "oven", "toaster", "sink", "refrigerator", "blender", "book", "clock", "vase", "scissors", "teddy bear", "hair drier", "toothbrush", "hair brush"
But only 80 classes have with annotations: "person", "bicycle", "car", "motorcycle", "airplane", "bus", "train", "truck", "boat", "traffic light", "fire hydrant", "stop sign", "parking meter", "bench", "bird", "cat", "dog", "horse", "sheep", "cow", "elephant", "bear", "zebra", "giraffe", "backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee", "skis", "snowboard", "sports ball", "kite", "baseball bat", "baseball glove", "skateboard", "surfboard", "tennis racket", "bottle", "wine glass", "cup", "fork", "knife", "spoon", "bowl", "banana", "apple", "sandwich", "orange", "broccoli", "carrot", "hot dog", "pizza", "donut", "cake", "chair", "couch", "potted plant", "bed", "dining table", "toilet", "tv", "laptop", "mouse", "remote", "keyboard", "cell phone", "microwave", "oven", "toaster", "sink", "refrigerator", "book", "clock", "vase", "scissors", "teddy bear", "hair drier", "toothbrush"
Boxes format:
For the object detection set of COCO dataset, the ground-truth bounding boxes are provided in the following format: x, y, width, height
in absolute coordinates.
Curation Rationale
COCO dataset was curated with the goal of advancing the state of the art in many tasks, such as object detection, dense pose, keypoints, segmentation and image classification.
Licensing Information
The annotations in this dataset belong to the COCO Consortium and are licensed under a Creative Commons Attribution 4.0 License.
Mode details at: https://cocodataset.org/#termsofuse
Loading dataset
You can load COCO 2017 dataset by calling:
from datasets import load_dataset
# Full dataset
dataset = load_dataset("rafaelpadilla/coco2017")
print(dataset)
>> DatasetDict({
>> train: Dataset({
>> features: ['image', 'image_id', 'objects'],
>> num_rows: 118287
>> })
>> val: Dataset({
>> features: ['image', 'image_id', 'objects'],
>> num_rows: 5000
>> })
>> })
# Training set only
dataset = load_dataset("rafaelpadilla/coco2017", split="train")
# Validation set only
dataset = load_dataset("rafaelpadilla/coco2017", split="val")
COCODataset Class
We offer the dataset class COCODataset
that extends VisionDataset to represents images and annotations of COCO. To use it, you need to install coco2017 package. For that, follow the steps below:
- Create and activate an environment:
conda create -n coco2017 python=3.11
conda activate coco2017
- Install cocodataset package:
pip install git+https://huggingface.co/datasets/rafaelpadilla/coco2017@main
or alternatively:
git clone https://huggingface.co/datasets/rafaelpadilla/coco2017
cd coco2017
pip install .
- Now you can import
COCODataset
class into your Python code by:
from cocodataset import COCODataset
Citation Information
@inproceedings{lin2014microsoft,
title={Microsoft coco: Common objects in context},
author={Lin, Tsung-Yi and Maire, Michael and Belongie, Serge and Hays, James and Perona, Pietro and Ramanan, Deva and Doll{'a}r, Piotr and Zitnick, C Lawrence},
booktitle={Computer Vision--ECCV 2014: 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part V 13},
pages={740--755},
year={2014},
organization={Springer}
}
Contributions
Tsung-Yi Lin Google Brain
Genevieve Patterson MSR, Trash TV
Matteo R. Ronchi Caltech
Yin Cui Google
Michael Maire TTI-Chicago
Serge Belongie Cornell Tech
Lubomir Bourdev WaveOne, Inc.
Ross Girshick FAIR
James Hays Georgia Tech
Pietro Perona Caltech
Deva Ramanan CMU
Larry Zitnick FAIR
Piotr Dollár FAIR