MS COCO官网数据集(百度云)下载,COCO API、MASK API和Annotation format介绍(来自官网)

由于coco的官网老是打不开,因此把官网内容记录在此

包括MS COCO官网数据集下载地址,COCO API介绍和Result Format介绍

下面是图像和注解下载地址:

Annotations

2014 Train/Val annotations [241MB]
2014 Testing Image info [1MB]
2015 Testing Image info [2MB]
2017 Train/Val annotations [241MB]
2017 Stuff Train/Val annotations [401MB]
2017 Testing Image info [1MB]
2017 Unlabeled Image info [4MB]


如果下载不下来可以用百度云下载

coco2014-2015年的数据集

链接:https://pan.baidu.com/s/1bpuaMtD 密码:12ya

coco2017年数据集太大了不让直接上传


1. 概述

你应该下载哪个数据集?每年的拆分(split)都与不同的挑战有关。特别地:

2014 Testing      Captioning 2015
2015 Testing      Detection 2015, Detection 2016, Keypoints 2016
2017 Train/Val    Detection 2017, Keypoints 2017, Stuff 2017
2017 Testing      Detection 2017, Keypoints 2017, Stuff 2017
2017 Unlabeled [optional data for any competition]
如果您提交2017年的挑战,只需要下载2017年的数据。您可以忽略较早的数据拆分。

为了有效地下载图像,我们建议使用gsutil rsync来避免下载大的zip文件。但由于我下不下来这个工具就没有用

我们的数据托管在Google云端平台(GCP)上。gsutil提供了有效访问这些数据的工具。您不需要GCP帐户即可使用gsutil。下载数据的说明如下:

(1) Install gsutil via:
curl https://sdk.cloud.google.com | bash
(2) Make local dir:
mkdir val2017
(3) Synchronize via:
gsutil -m rsync gs://images.cocodataset.org/val2017 val2017

The splits are available for download via rsync are: train2014, val2014, test2014, test2015, train2017, val2017, test2017, unlabeled2017. Simply replace 'val2017' with the split you wish to download and repeat steps (2)-(3). Finally, you can also download all the annotation zip files via:

(4) Get annotations:
gsutil -m rsync gs://images.cocodataset.org/annotations [localdir]

The download is multi-threaded, you can control other options of the download as well (seegsutil rsync). Please do not contact us with helpinstalling gsutil (we note only that you do not need to run gcloud init).



请按照COCO API Readme自述文件中的说明设置下载的COCO数据(图像和注释)。 通过下载这个数据集,您同意我们的使用条款。

2017更新:2017年的主要变化是,根据社区反馈,而不是一个80K / 40K train/ val拆分,现在train/ val的拆分是115K / 5K。使用相同的准确的图像,并且不提供用于检测/关键点的新注释。然而,2017年新增了40Ktrain图片(2017年全部115K列车图片的子集)和5K val图片的注释。此外,为了进行测试,在2017年,测试集只有两个拆分(dev / challenge),而不是前几年使用的四个拆分(dev / standard / reserve / challenge)。最后,2017年的新作品发布了COCO的120K无标签图片,与标签图片一样,这可能对COCO的半监督学习有用。

注意:注释最后更新09/05/2017(添加了注释)。如果您发现有关数据的任何问题,请让我们知道!

2. COCO API

COCO API帮助加载,解析和可视化COCO中的注释。API支持对象实例(object instance),对象关键点(object keypoint)和图像标题(image caption)注释(对于标题,并非所有功能都已定义)。有关更多详情,请参阅:CocoApi.m,coco.py, and CocoApi.lua for Matlab, Python, and Lua code, respectively, and also the Python API demo.

Throughout the API "ann"=annotation, "cat"=category, and "img"=image.
download           从mscoco.org服务器下载COCO图像。
getAnnIds          获取满足给定过滤器条件的ann ids。
getCatIds           获取满足给定过滤条件的cat ID。
getImgIds          获取满足给定过滤条件的img ids。
loadAnns           用指定的id加载anns。
loadCats            使用指定的ID加载类别。
loadImgs           用指定的id加载imgs。
loadRes            加载算法结果并创建用于访问它们的API。
showAnns        显示指定的注释。

3. MASK API

COCO为每个对象实例提供分割掩码。这产生了两个挑战:紧凑地存储掩码并有效地执行掩码计算。我们使用自定义运行长度编码(RLE,Run Length Encoding)方案来解决这两个挑战。RLE表示的大小与掩码的边界像素的数量成比例,并且可以直接在RLE上有效地计算诸如面积,联合或相交(area, union, or intersection)的操作。具体而言,假设相当简单的形状,RLE表示是O(√n),其中n是对象中像素的数量,并且公共计算同样是O(√n)。天真地计算解码掩码(存储为数组)相同的操作将是O(n)。

MASK API提供了一个操作以RLE格式存储的掩码的界面。该API定义如下,其他细节请参阅:MaskApi.m,mask.py, or MaskApi.lua.。 最后,我们注意到,大部分的实际真值(ground truth)掩码被存储为多边形(polygons)(非常紧凑),这些多边形在需要时被转换为RLE。
encode                 使用RLE编码二进制掩码。
decode                解码通过RLE编码的二进制掩码。
merge                  计算编码掩码的联合或交集(union, or intersection)。
iou                        计算掩码之间的联合的交集(intersection over union)。
area                     计算编码掩码的区域(area)。
toBbox                获取围绕编码掩码的边界框(bounding boxes)。
frBbox                 将边界框转换为编码的掩码(Convert bounding boxes to encoded masks.)。
frPoly                  将多边形转换为编码掩码(Convert polygon to encoded mask)。

4. Annotation format

COCO目前有三种注解类型:对象实例,对象关键点和图像标题。注释使用JSON文件格式存储。所有注释共享下面的基本数据结构:
{
    "info": info,
    "images": [image],
    "annotations": [annotation],
    "licenses": [license],
}

info{
    "year": int,
    "version": str,
    "description": str,
    "contributor": str,
    "url": str,
    "date_created": datetime,
}

image{
    "id": int,
    "width": int,
    "height": int,
    "file_name": str,
    "license": int,
    "flickr_url": str,
    "coco_url": str,
    "date_captured": datetime,
}

license{
    "id": int,
    "name": str,
    "url": str,
}

下面介绍各种注释类型特有的数据结构。

4.1. Object Instance Annotations

每个实例注释包含一系列字段,包括对象的类别ID和分割掩码(segmentation mask)。分割格式取决于实例是否代表单个对象(iscrowd = 0,在这种情况下使用多边形)或对象集合(iscrowd = 1,在这种情况下使用RLE)。请注意,单个对象(iscrowd = 0)可能需要多个多边形,例如,如果被遮挡。人群注释(Crowd annotations)(iscrowd = 1)用于标记大量对象(例如一群人)。此外,还为每个对象提供了一个封闭的边界框(框坐标是从左上角的图像角度测量的,并且是0索引的)。最后,注解结构的类别字段存储了类别ID到类别和超类别名称的映射。 See also theDetection Challenge.

annotation{
    "id": int,
    "image_id": int,
    "category_id": int,
    "segmentation": RLE or [polygon],
    "area": float,
    "bbox": [x,y,width,height],
    "iscrowd": 0 or 1,
}

categories[{
    "id": int,
    "name": str,
    "supercategory": str,
}]

4.2. Object Keypoint Annotations

关键点注释包含对象注释的所有数据(包括id,bbox等)和两个附加字段。首先,“关键点”是长度为3k的数组,其中k是为该类别定义的关键点的总数。每个关键点有一个0索引的位置x,y和一个被定义为可见性标志。v = 0:没有标记(在这种情况下x = y = 0),v = 1:标记但不可见,v = 2:标记并可见。如果关键点位于对象段内部,则认为它是可见的。“num_keypoints”指示给定对象(许多对象,例如拥挤(即重叠)和小对象将具有num_keypoints = 0)的标记关键点的数量(v> 0)。最后,对于每个类别,类别struct还有两个附加字段:“keypoints”,它是关键点名称的长度为k的数组,以及“skeleton”,它通过关键点边缘对的列表定义连接,并用于可视化。目前,关键点仅标记为人物类别(对于大多数中/大型非人群人物实例)。See also the Keypoint Challenge.

annotation{
    "keypoints": [x1,y1,v1,...],
    "num_keypoints": int,
    "[cloned]": ...,
}

categories[{
    "keypoints": [str],
    "skeleton": [edge],
    "[cloned]": ...,
}]

"[cloned]": 表示从4.1中定义的对象实例注释复制的字段。

4.3. Stuff Segmentation Annotations

物体注释格式是完全相同和完全兼容上面的对象实例注释格式(除了iscrowd是不必要的,默认设置为0)。我们提供JSON和PNG格式的注释,以便于访问,以及两种格式之间的conversion scripts在JSON格式中,图像中的每个类别都使用单个RLE注释进行编码(有关更多详细信息,请参阅上面的Mask API)。 category_id表示当前的东西类别的ID。有关东西类别和超类别的更多细节see thestuff evaluation page.

4.4. Image Caption Annotations

这些注释用于存储图像标题。每个标题描述指定的图像,每个图像至少有5个字幕(一些图像有更多)。See also theCaptioning Challenge.

annotation{
    "id": int,
    "image_id": int,
    "caption": str,
}


猜你喜欢

转载自blog.csdn.net/u014734886/article/details/78830713