coco2017 / README.md
shijli's picture
Add the dataset card
49cb555 verified
|
Raw History Blame Contribute Delete
8.11 kB
---
dataset_info:
config_name: detection
features:
- name: id
dtype: string
- name: image
dtype: image
- name: width
dtype: int32
- name: height
dtype: int32
- name: license
dtype: string
- name: license_url
dtype: string
- name: flickr_url
dtype: string
- name: coco_url
dtype: string
- name: objects
struct:
- name: annotation_id
list: int64
- name: category
list:
class_label:
names:
'0': person
'1': bicycle
'2': car
'3': motorcycle
'4': airplane
'5': bus
'6': train
'7': truck
'8': boat
'9': traffic light
'10': fire hydrant
'11': stop sign
'12': parking meter
'13': bench
'14': bird
'15': cat
'16': dog
'17': horse
'18': sheep
'19': cow
'20': elephant
'21': bear
'22': zebra
'23': giraffe
'24': backpack
'25': umbrella
'26': handbag
'27': tie
'28': suitcase
'29': frisbee
'30': skis
'31': snowboard
'32': sports ball
'33': kite
'34': baseball bat
'35': baseball glove
'36': skateboard
'37': surfboard
'38': tennis racket
'39': bottle
'40': wine glass
'41': cup
'42': fork
'43': knife
'44': spoon
'45': bowl
'46': banana
'47': apple
'48': sandwich
'49': orange
'50': broccoli
'51': carrot
'52': hot dog
'53': pizza
'54': donut
'55': cake
'56': chair
'57': couch
'58': potted plant
'59': bed
'60': dining table
'61': toilet
'62': tv
'63': laptop
'64': mouse
'65': remote
'66': keyboard
'67': cell phone
'68': microwave
'69': oven
'70': toaster
'71': sink
'72': refrigerator
'73': book
'74': clock
'75': vase
'76': scissors
'77': teddy bear
'78': hair drier
'79': toothbrush
- name: category_id
list: int32
- name: bbox
list:
list: float64
length: 4
- name: area
list: float64
- name: iscrowd
list: int8
- name: segmentation
list: string
splits:
- name: train
num_bytes: 20208266269
num_examples: 118287
- name: validation
num_bytes: 828791908
num_examples: 5000
download_size: 20532028806
dataset_size: 21037058177
configs:
- config_name: detection
data_files:
- split: train
path: detection/train-*
- split: validation
path: detection/validation-*
default: true
size_categories:
- 100K<n<1M
license_link: https://cocodataset.org/#termsofuse
extra_gated_fields:
I will check the license of each image before using it: checkbox
I will not use images whose license forbids commercial use for commercial purposes: checkbox
I will cite COCO in publications that use this dataset: checkbox
pretty_name: COCO 2017
tags:
- coco
- object-detection
- instance-segmentation
- ms-coco
license_name: coco
license: other
task_categories:
- object-detection
extra_gated_prompt: 'COCO 2017 is distributed by the COCO Consortium. The annotations
are licensed under CC BY 4.0. The COCO Consortium does not own the copyright of
the images: the images come from Flickr and remain under their respective Creative
Commons licenses, and about 70% of them are non-commercial. Check the license of
each image (license/license_url) before using it, and cite the original work.'
language:
- en
---
# COCO 2017
COCO 2017 instance detection, packed once with the official annotations kept whole.
## What is here
- `train`: 118,287 images (`train2017`)
- `validation`: 5,000 images (`val2017`)
- 80 categories with COCO's official ids, 1 to 90 (12, 26, 29, ... are unused)
- Every official annotation column: annotation id, category id, bbox, area, iscrowd, segmentation
- Every image's official license and source URLs, because the images come from Flickr and are not all under the same license
- All 5,000 validation images are kept, including the 48 that have no annotations; their `objects` lists are empty
`test2017` is not included: the official test annotations are not public (the test server only), so there is nothing to pack.
## Schema
| column | type | meaning |
| --- | --- | --- |
| `id` | string | image id, the zero-padded file name stem (e.g. `000000000139`) |
| `image` | Image | the original JPEG bytes |
| `width`, `height` | int32 | image size |
| `license`, `license_url` | string | the image's official Flickr license name and URL |
| `flickr_url`, `coco_url` | string | the image's original source URLs |
| `objects.annotation_id` | int64 | official annotation id |
| `objects.category` | ClassLabel | the 80 names in official id order; the index is 0 to 79 |
| `objects.category_id` | int32 | COCO's official category id, 1 to 90 with gaps |
| `objects.bbox` | list of 4 float64 | official `[x, y, w, h]`, absolute pixels, top-left origin |
| `objects.area` | float64 | official area in pixels |
| `objects.iscrowd` | int8 | 1 for a crowd region the official evaluator ignores |
| `objects.segmentation` | string | official segmentation as JSON: polygon lists, or the RLE dict for crowd boxes |
`category` is the readable class name; `category_id` keeps the official number so a consumer can
map straight back to the COCO category ids. No annotation is filtered, merged or renumbered.
## Usage
```python
from datasets import load_dataset
ds = load_dataset("<user>/coco2017", "detection")
```
Replace `<user>` with the repo owner.
## Source and license
Official COCO 2017: <https://cocodataset.org/>.
> The annotations in this dataset are licensed under a Creative Commons Attribution 4.0 License.
> The COCO Consortium does not own the copyright of the images. Use of the images must abide by
> the Flickr Terms of Use. The users of the images accept full responsibility for the use of the
> dataset, including but not limited to the use of any copies of copyrighted images that they may
> create from the dataset.
Each image's license is in `license`/`license_url`. The images come from Flickr under different
Creative Commons licenses, and about 70% of train and validation images are non-commercial
(`BY-NC`, `BY-NC-SA`, `BY-NC-ND`): check the per-image license before using an image, especially
for commercial work. This packaging adds no rights; use it under the COCO
[terms of use](https://cocodataset.org/#termsofuse) and cite the original work.
```bibtex
@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 (ECCV)},
pages={740--755},
year={2014},
organization={Springer}
}
```
## Reproducing this dataset
`create_dataset.py` in this repo builds the parquet from an unpacked official COCO 2017 folder:
```bash
python create_dataset.py --dry-run --coco-root /path/to/coco --limit 20
python create_dataset.py --repo <user>/coco2017 --coco-root /path/to/coco
```
It checks the packed box counts, a random sample of records and the image bytes against the
official `instances_*.json` files before uploading.