coco数据集标注格式

coco数据集标注格式


COCO数据集现在有3种标注类型:object instances(目标实例), object keypoints(目标上的关键点), 和image captions(看图说话),使用JSON文件存储。

以下主要介绍目标检测(目标实例):
  COCO数据集中目标实例的json文件整体是以字典的形式来存储内容的。主要包括5个key(info、licenses、images、annotations、categories)。

{ 
    "info" : info,
    "licenses" : [license],
    "images" : [image],
    "annotations" : [annataton],
    "categories" : [category]
}

info这个key对应的值的类型是一个字典;
licenses, images, annatations 和 categories这几个key对应的值的类型是一个列表,列表当中存储的数据类型依旧是字典。

每个key对应的内容:

info{
"year" : int,                # 年份
"version" : str,             # 版本
"description" : str,         # 详细描述信息
"contributor" : str,         # 作者
"url" : str,                 # 协议链接
"date_created" : datetime,   # 生成日期
}
"images": [                                            
{"id": 0,                                                # int 图像id,可从0开始
 "file_name": "0.jpg",                                   # str 文件名
 "width": 512,                                           # int 图像的宽
 "height": 512,                                          # int 图像的高
 "date_captured": "2020-04-14 01:45:07.508146",          # datatime 获取日期
 "license": 1,                                           # int 遵循哪个协议
 "coco_url": "",                                         # str coco图片链接url
 "flickr_url": ""                                        # str flick图片链接url
}]
 "licenses": [
{
 "id": 1,                                            # int 协议id号      在images中遵循的license即1
 "name": null,                                       # str 协议名        
 "url": null                                         # str 协议链接      
}]
"annotations": [ 
{
 "id": 0,                                   # int 图片中每个被标记物体的id编号
 "image_id": 0,                             # int 该物体所在图片的编号
 "category_id": 2,                          # int 被标记物体的类别id编号
 "iscrowd": 0,                              # 0 or 1 目标是否被遮盖,默认为0
 "area": 4095.9999999999986,                # float 被检测物体的面积(64 * 64 = 4096)
 "bbox": [200.0, 416.0, 64.0, 64.0],        # [x, y, width, height] 目标检测框的坐标信息
 "segmentation": [[200.0, 416.0, 264.0, 416.0, 264.0, 480.0, 200.0, 480.0]]  
}]
# "bbox"里[x, y, width, height]x, y代表的是物体的左上角的x, y的坐标值。
#"segmentation"里[x1, y1, x2, y2, x3, y3, x4, y4]是以左上角坐标为起始,顺时针依次选取的另外三个坐标点。及[左上x, 左上y, 右上x,右上y,右下x,右下y,左下x,左下y]。
"categories":[
{
 "id": 1,                                 # int 类别id编号
 "name": "rectangle",                     # str 类别名字
 "supercategory": "None"                  # str 类别所属的大类,如卡车和轿车都属于机动车这个class
}, 
{
 "id": 2,
 "name": "circle", 
 "supercategory": "None"
 }
]

以上。

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
青葱年少的头像青葱年少普通用户
上一篇 2023年8月6日
下一篇 2023年8月6日

相关推荐