File size: 5,992 Bytes
7d5136d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
---
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](https://arxiv.org/abs/1405.0312)

### 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:

1. Create and activate an environment:
```
conda create -n coco2017 python=3.11 
conda activate coco2017
```

2. 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 .
```

3. 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