COCO Dataset

Estimated reading: 5 minutes 678 views

Visualization of the COCO Dataset on the Deep Lake UI

COCO dataset

Click to visualize COCO Train Dataset on the Deep Lake UI

What is COCO Dataset?

The COCO (Common Objects in Context) dataset comprises 91 common object categories, 82 of which have more than 5,000 labeled examples. The dataset has 2.5 million labeled instances in 328k photos, created with the help of a large number of crowd workers using unique user interfaces for category detection, instance spotting, and instance segmentation. COCO dataset is a novel dataset with the purpose of improving the state-of-the-art in object detection by aligning the problem within the larger framework of scene understanding.

Download COCO Dataset in Python

Instead of downloading the COCO dataset in Python, you can effortlessly load it in Python via our Deep Lake open-source with just one line of code.

Load COCO Dataset Training Subset in Python

				
					import deeplake
ds = deeplake.load("hub://activeloop/coco-train")
				
			

Load COCO Dataset Testing Subset in Python

				
					import deeplake
ds = deeplake.load("hub://activeloop/coco-test")
				
			

Load COCO Dataset Validation Subset in Python

				
					import deeplake
ds = deeplake.load("hub://activeloop/coco-val")
				
			

COCO Dataset Structure

COCO Data Fields
  • images: tensor containing images.
  • images_meta: tensor containing metadata of images.
  • masks: tensor containing the binary masks.
  • boxes: tensor containing the bounding box coordinates.
  • categories: tensor containing the numerical label which represents the position of the object in a list of 80 object categories.
  • super_categories: tensor containing the numerical label which represents the position of the object in a list of 12 super categories.
  • areas: tensor containing the area.
  • iscrowds: tensor containing a boolean value that represents if the data is crowd annotated.
  • pose/categories: tensor containing the numerical label which represents the position of the different pose categories in a list.
  • pose/super_categories: tensor containing the numerical label which represents the position of the different pose super categories in a list.
  • pose/boxes: tensor containing the bounding box coordinates for pose estimation.
  • pose/masks: tensor containing the binary masks for pose estimation.
  • pose/keypoints: tensor containing keypoints.
  • stuff/masks: tensor containing the binary masks for stuff such as desk, door, mirror and window.
  • stuff/boxes: tensor containing the bounding box coordinates.
  • stuff/categories: tensor containing numerical label which represents the index of the object in a list of object categories.
  • stuff/super_categories: tensor containing numerical label which represents the index of the object in a list of object categories.
  • stuff/areas: tensor containing area.
  • stuff/iscrowds: tensor containing boolean value to represent if the data is crowd annotated.
COCO Data Splits
  • The COCO dataset training set is composed of 118k images.
  • The COCO dataset validation set is composed of 5k images.
  • The COCO dataset test set is composed of 20k images

How to use COCO Dataset with PyTorch and TensorFlow in Python

Train a model on COCO dataset with PyTorch in Python

Let’s use Deep Lake built-in PyTorch one-line dataloader to connect the data to the compute:

				
					dataloader = ds.pytorch(num_workers=0, batch_size=4, shuffle=False)
				
			
Train a model on COCO dataset with TensorFlow in Python
				
					dataloader = ds.tensorflow()
				
			

COCO Dataset Creation

Train a model on COCO dataset with PyTorch in Python

To advance the improvement of object detection and segmentation algorithms, a massive number of object instances were gathered, labeled, and structured. The search for non-iconic photographs of objects in realistic settings and from various perspectives was prioritized. Dataset statistics show that the photographs include a lot of contextual information and have a lot of items in each image.

Additional Information about COCO Dataset

COCO Dataset Description

  • Paper: Lin, T. Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., … & Zitnick, C. L. (2014, September). Microsoft coco: Common objects in context. In European conference on computer vision (pp. 740-755). Springer, Cham.
COCO Dataset Curators

Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, C. Lawrence Zitnick

COCO Dataset Licensing 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={European conference on computer vision},
pages={740--755},
year={2014},
organization={Springer}
}
				
			

COCO Dataset FAQs

What is the COCO dataset for Python?

The COCO dataset (Common Objects in Context) advances object recognition by placing the images of an object recognition dataset in the context of scene understanding. This is accomplished by collecting images of complicated daily scenes having ordinary objects in their natural context. Alongside the MNIST dataset, COCO is one of the most popular datasets.

What is the COCO dataset used for?

The COCO dataset is one of the most popular open-source object recognition datasets used to train deep learning programs. Also, COCO is frequently used to benchmark algorithms to compare real-time object detection performance.

How to download the COCO dataset in Python?

You can load the COCO dataset quickly with one line of code using the Activeloop Deep Lake the open-source package made in Python. Check out detailed instructions on how to load the COCO dataset training subset or COCO dataset testing subset in Python.

How can I use COCO dataset in PyTorch or TensorFlow?

You can train a model on the COCO dataset with PyTorch in Python or train a model on COCO dataset with TensorFlow in Python. You can stream the COCO dataset while training a model in PyTorch or TensorFlow with one line of code using the open-source package Activeloop Deep Lake in Python.

Should I work with COCO dataset in CSV?

No. Instead of downloading the COCO dataset CSV, you can easily load, version-control, query, and manipulate COCO for machine learning purposes using Activeloop Deep Lake. This is better than working in CSV since CSV is not optimized for working with image data, especially for machine learning workflows.

CONTENTS