Standard COCO format json file content

The coco format described in this article is the object instances format in the standard coco data set. The basic information of the coco format is described as follows:

{
    
    
    "info": info,                   #描述数据集的相关信息,内部由字典组成
    "licenses": [license],          #列表形式,内部由字典组成
    "images": [image],              #描述图片信息,列表形式,内部由字典组成,字典数量为图片数量
    "annotations": [annotation],    #描述bounding box信息列表形式,内部由字典组成,字典数量为bounding box数量
     "categories": [category]       # 描述图片类别信息,列表形式 ,内部由字典组成,字典数量为类别个数
}

The format of the coco annotation file is a .json file, and the annotation information of all pictures is in a .json file. The json file consists of the dictionary described above. The dictionary has five keys, in which the coordinate information of coco is (xmin, ymin ,w,h), (xmin,ymin) represents the coordinates of the upper left corner of the labeling box. These four values ​​​​are absolute values. The details of the value corresponding to each key will be described below:

info{
    
    
    "year": int,               #年份
    "version": str,            #数据集版本
    "description": str,        #数据集描述
    "contributor": str,        #数据集的提供者
    "url": str,                #数据集的下载地址
    "date_created": datetime,  #数据集的创建日期
}
license{
    
                         
    "id": int,
    "name": str,
    "url": str,
} 
image{
    
    
    "id": int,                    #图片标识,相当于图片的身份证
    "width": int,                 #图片宽度
    "height": int,                #图片高度
    "file_name": str,             #图片名称,注意不是图片的路径,仅仅是名称
    "license": int,
    "flickr_url": str,            #flicker网络地址
    "coco_url": str,              #网络地址路径
    "date_captured": datetime,    #图片获取日期 
}
annotation{
    
     
    "id": int,                                #bounding box标识,相当于bounding box身份证
    "image_id": int,                          #图片标识,和image中的"id"对应
    "category_id": int,                       #类别id
    "segmentation": RLE or [polygon],         #描述分割信息,iscrowd=0,则segmentation是polygon格式;iscrowd=1,则segmentation就是RLE格式
    "area": float,                            #标注框面积
    "bbox": [x,y,width,height],               #标注框坐标信息,前文有描述
    "iscrowd": 0 or 1,                        #是否有遮挡,无遮挡为0,有遮挡为1
}
category{
    
    
    "id": int,                                #类别id,注意从1开始,而不是从0开始
    "name": str,                              #类别名称
    "supercategory": str,                     #该类别的超类
}

Guess you like

Origin blog.csdn.net/qq_34972053/article/details/130622204