刚写完coco数据集,顺便把voc数据集的标注格式也介绍一下~
两个标注格式最大的不同当然就是:
coco标注的文件是json格式的,上一篇博客已经有完整的介绍了
而voc则是xml格式的~
Pascal VOC数据集介绍
首先,voc数据集下载下来会有这么几个文件夹:
- Annotations
- ImageSets
- JPEGImages
- SegmentationClass
- SegmentationObject
1、JPEGImages
主要提供的是PASCAL VOC所提供的所有的图片信息,包括训练图片,测试图片
这些图像就是用来进行训练和测试验证的图像数据。
2、Annotations
主要存放xml格式的标签文件,每个xml对应JPEGImage中的一张图片
<annotation>
<folder>VOC2012</folder>
<filename>2007_000392.jpg</filename> //文件名
<source> //图像来源(不重要)
<database>The VOC2007 Database</database>
<annotation>PASCAL VOC2007</annotation>
<image>flickr</image>
</source>
<size> //图像尺寸(长宽以及通道数)
<width>500</width>
<height>332</height>
<depth>3</depth>
</size>
<segmented>1</segmented> //是否用于分割(在图像物体识别中01无所谓)
<object> //检测到的物体
<name>horse</name> //物体类别
<pose>Right</pose> //拍摄角度
<truncated>0</truncated> //是否被截断(0表示完整)
<difficult>0</difficult> //目标是否难以识别(0表示容易识别)
<bndbox> //bounding-box(包含左下角和右上角xy坐标)
<xmin>100</xmin>
<ymin>96</ymin>
<xmax>355</xmax>
<ymax>324</ymax>
</bndbox>
</object>
<object> //检测到多个物体
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>198</xmin>
<ymin>58</ymin>
<xmax>286</xmax>
<ymax>197</ymax>
</bndbox>
</object>
</annotation>
3、ImageSets
- Action // 人的动作
- Layout // 人体的具体部位
- Main // 图像物体识别的数据,总共20类, 需要保证train val没有交集
- train.txt
- val.txt
- trainval.txt
- Segmentation // 用于分割的数据
4、SegmentationObject & SegmentationClass
保存的是物体分割后的数据,在物体识别中没有用到