<br />

- **Description**:

COCO is a large-scale object detection, segmentation, and captioning dataset.

> [!NOTE]
> **Note:**

- Some images from the train and validation sets don't have annotations.
- Coco 2014 and 2017 uses the same images, but different train/val/test splits
- The test split don't have any annotations (only images).
- Coco defines 91 classes but the data only uses 80 classes.
- Panotptic annotations defines defines 200 classes but only uses 133.

- **Additional Documentation** :
  [Explore on Papers With Code](https://paperswithcode.com/dataset/coco)

- **Homepage** : <http://cocodataset.org/#home>

- **Source code** :
  [`tfds.object_detection.Coco`](https://github.com/tensorflow/datasets/tree/master/tensorflow_datasets/object_detection/coco.py)

- **Versions**:

  - **`1.1.0`** (default): No release notes.
- **Auto-cached**
  ([documentation](https://www.tensorflow.org/datasets/performances#auto-caching)):
  No

- **Supervised keys** (See
  [`as_supervised` doc](https://www.tensorflow.org/datasets/api_docs/python/tfds/load#args)):
  `None`

- **Citation**:

    @article{DBLP:journals/corr/LinMBHPRDZ14,
      author    = {Tsung{-}Yi Lin and
                   Michael Maire and
                   Serge J. Belongie and
                   Lubomir D. Bourdev and
                   Ross B. Girshick and
                   James Hays and
                   Pietro Perona and
                   Deva Ramanan and
                   Piotr Doll{'{a} }r and
                   C. Lawrence Zitnick},
      title     = {Microsoft {COCO:} Common Objects in Context},
      journal   = {CoRR},
      volume    = {abs/1405.0312},
      year      = {2014},
      url       = {http://arxiv.org/abs/1405.0312},
      archivePrefix = {arXiv},
      eprint    = {1405.0312},
      timestamp = {Mon, 13 Aug 2018 16:48:13 +0200},
      biburl    = {https://dblp.org/rec/bib/journals/corr/LinMBHPRDZ14},
      bibsource = {dblp computer science bibliography, https://dblp.org}
    }

## coco/2014 (default config)

- **Config description**: This version contains images, bounding boxes and
  labels for the 2014 version.

- **Download size** : `37.57 GiB`

- **Dataset size** : `37.35 GiB`

- **Splits**:

| Split | Examples |
|---|---|
| `'test'` | 40,775 |
| `'test2015'` | 81,434 |
| `'train'` | 82,783 |
| `'validation'` | 40,504 |

- **Feature structure**:

    FeaturesDict({
        'image': Image(shape=(None, None, 3), dtype=uint8),
        'image/filename': Text(shape=(), dtype=string),
        'image/id': int64,
        'objects': Sequence({
            'area': int64,
            'bbox': BBoxFeature(shape=(4,), dtype=float32),
            'id': int64,
            'is_crowd': bool,
            'label': ClassLabel(shape=(), dtype=int64, num_classes=80),
        }),
    })

- **Feature documentation**:

| Feature | Class | Shape | Dtype | Description |
|---|---|---|---|---|
|   | FeaturesDict |   |   |   |
| image | Image | (None, None, 3) | uint8 |   |
| image/filename | Text |   | string |   |
| image/id | Tensor |   | int64 |   |
| objects | Sequence |   |   |   |
| objects/area | Tensor |   | int64 |   |
| objects/bbox | BBoxFeature | (4,) | float32 |   |
| objects/id | Tensor |   | int64 |   |
| objects/is_crowd | Tensor |   | bool |   |
| objects/label | ClassLabel |   | int64 |   |

- **Figure** ([tfds.show_examples](https://www.tensorflow.org/datasets/api_docs/python/tfds/visualization/show_examples)):

![Visualization](https://storage.googleapis.com/tfds-data/visualization/fig/coco-2014-1.1.0.png)

- **Examples** ([tfds.as_dataframe](https://www.tensorflow.org/datasets/api_docs/python/tfds/as_dataframe)):

<iframe src="https:///frame/datasets/catalog/coco_d0dcd82229848461e6ce3c0fbf9347a88fd0f284d94730351c9a74ca5843eab5.frame" class="framebox inherit-locale " allow="clipboard-write https://" allowfullscreen is-upgraded></iframe>

## coco/2017

- **Config description**: This version contains images, bounding boxes and
  labels for the 2017 version.

- **Download size** : `25.20 GiB`

- **Dataset size** : `24.98 GiB`

- **Splits**:

| Split | Examples |
|---|---|
| `'test'` | 40,670 |
| `'train'` | 118,287 |
| `'validation'` | 5,000 |

- **Feature structure**:

    FeaturesDict({
        'image': Image(shape=(None, None, 3), dtype=uint8),
        'image/filename': Text(shape=(), dtype=string),
        'image/id': int64,
        'objects': Sequence({
            'area': int64,
            'bbox': BBoxFeature(shape=(4,), dtype=float32),
            'id': int64,
            'is_crowd': bool,
            'label': ClassLabel(shape=(), dtype=int64, num_classes=80),
        }),
    })

- **Feature documentation**:

| Feature | Class | Shape | Dtype | Description |
|---|---|---|---|---|
|   | FeaturesDict |   |   |   |
| image | Image | (None, None, 3) | uint8 |   |
| image/filename | Text |   | string |   |
| image/id | Tensor |   | int64 |   |
| objects | Sequence |   |   |   |
| objects/area | Tensor |   | int64 |   |
| objects/bbox | BBoxFeature | (4,) | float32 |   |
| objects/id | Tensor |   | int64 |   |
| objects/is_crowd | Tensor |   | bool |   |
| objects/label | ClassLabel |   | int64 |   |

- **Figure** ([tfds.show_examples](https://www.tensorflow.org/datasets/api_docs/python/tfds/visualization/show_examples)):

![Visualization](https://storage.googleapis.com/tfds-data/visualization/fig/coco-2017-1.1.0.png)

- **Examples** ([tfds.as_dataframe](https://www.tensorflow.org/datasets/api_docs/python/tfds/as_dataframe)):

<iframe src="https:///frame/datasets/catalog/coco_b887a2b1261acdaacff6230b2c397648cc00d8f11559523a6fd6cdb004008210.frame" class="framebox inherit-locale " allow="clipboard-write https://" allowfullscreen is-upgraded></iframe>

## coco/2017_panoptic

- **Config description**: This version contains images, bounding boxes and
  labels for the 2017 version.

- **Download size** : `19.57 GiB`

- **Dataset size** : `19.63 GiB`

- **Splits**:

| Split | Examples |
|---|---|
| `'train'` | 118,287 |
| `'validation'` | 5,000 |

- **Feature structure**:

    FeaturesDict({
        'image': Image(shape=(None, None, 3), dtype=uint8),
        'image/filename': Text(shape=(), dtype=string),
        'image/id': int64,
        'panoptic_image': Image(shape=(None, None, 3), dtype=uint8),
        'panoptic_image/filename': Text(shape=(), dtype=string),
        'panoptic_objects': Sequence({
            'area': int64,
            'bbox': BBoxFeature(shape=(4,), dtype=float32),
            'id': int64,
            'is_crowd': bool,
            'label': ClassLabel(shape=(), dtype=int64, num_classes=133),
        }),
    })

- **Feature documentation**:

| Feature | Class | Shape | Dtype | Description |
|---|---|---|---|---|
|   | FeaturesDict |   |   |   |
| image | Image | (None, None, 3) | uint8 |   |
| image/filename | Text |   | string |   |
| image/id | Tensor |   | int64 |   |
| panoptic_image | Image | (None, None, 3) | uint8 |   |
| panoptic_image/filename | Text |   | string |   |
| panoptic_objects | Sequence |   |   |   |
| panoptic_objects/area | Tensor |   | int64 |   |
| panoptic_objects/bbox | BBoxFeature | (4,) | float32 |   |
| panoptic_objects/id | Tensor |   | int64 |   |
| panoptic_objects/is_crowd | Tensor |   | bool |   |
| panoptic_objects/label | ClassLabel |   | int64 |   |

- **Figure**
  ([tfds.show_examples](https://www.tensorflow.org/datasets/api_docs/python/tfds/visualization/show_examples)):
  Not supported.

- **Examples**
  ([tfds.as_dataframe](https://www.tensorflow.org/datasets/api_docs/python/tfds/as_dataframe)):

<iframe src="https:///frame/datasets/catalog/coco_1aa0bb723c139d88f17a3442f221ead693a85fff3b3b5d481b94b61f286ac75c.frame" class="framebox inherit-locale " allow="clipboard-write https://" allowfullscreen is-upgraded></iframe>