目标检测常用的标签格式

数据集的标注文件分为两个版本:有向目标边框(Oriented Bounding Box,OBB)与水平目标边框(Horizontal Bounding Box,HBB)。

一、COCO

COCO数据集,是将所有图像的标签信息和类别信息存放在一个json文件。COCO数据集标签的主要内容如下:

{
    "images": [
        {
            "file_name": "221.tif",
            "height": 3380,
            "width": 5857,
            "id": 0
        },……
    ],
    "annotations": [
        {
            "area": 7840,
            "iscrowd": 0,
            "image_id": 0,
            "bbox": [
                3393,
                2399,
                112,
                70
            ],
            "category_id": 1,
            "id": 0,
            "ignore": 0
        },……
    ],
    "categories": [
        {
            "id": 1,
            "name": "uncross"
        },……
    ]
}

二、VOC

VOC数据集,将每一张图像的标签信息单独保存在一个xml文件中。VOC数据集标签的主要内容如下:


<annotation>
	<folder>VOC2007folder>
	<filename>文件名filename>
	<source> # 图像来源(不重要)
		<database>My Databasedatabase>
		<annotation>VOC2007annotation>
		<image>flickrimage>
	source>
	<size> # 图像尺寸
		<width>640width>
		<height>640height>
		<depth>3depth>
	size>
	<segmented>0segmented> # 是否用于物体分割,取值0或1
	<object> # 目标框
		<name>类别名称name>
		<pose>拍摄姿势pose>
		<truncated>0truncated> # 是否被截断(0表示完整)
		<difficult>0difficult> # 目标是否难以识别(0表示容易识别)
		<bndbox> # 目标框(包含左下角和右上角xy坐标)
			<xmin>368xmin>
			<ymin>436ymin>
			<xmax>410xmax>
			<ymax>466ymax>
			<angle>-21.447731018066406angle> # 旋转目标框时存在
		bndbox>
	object>
annotation>

三、DOTA

DOTA数据集,将每一张图像的标签信息单独保存在一个txt文件中。DOTA数据集标签的主要内容如下:

'imagesource':imagesource
'gsd':gsd
x1, y1, x2, y2, x3, y3, x4, y4, category, difficult
x1, y1, x2, y2, x3, y3, x4, y4, category, difficult

imagesource:图像数据来源;

gsd:地面采样距离(一个图像像素的物理尺寸,单位为m),缺少该注释则为null;

x1, y1, x2, y2, x3, y3, x4, y4:四边形边框的四点坐标,其中(x1,y1)用于表示OBB的顶点起点的位置,四个顶点按照顺时针进行排列(顶点顺序对于部分需要检测目标具体方位的场景非常重要)。

category:目标所属类别;

diffcult:该目标实例的检测难度,1为高,0为低。

你可能感兴趣的:(学习记录)