我通过将数据集调整为下方展示的PASCAL VOC格式,成功地在自己的数据集上重新训练了对象检测模块。
这种格式是基于边界框的,通过查看他们的TFRecords创建脚本,可以看出它确实需要大量的这些真实值来生成相应的TFRecords。
边界框的问题在于,它提供的是近似值,并且对旋转图像进行标注可能相当具有挑战性。
经过一番查找,我发现了labelme,它允许你进行形状(点对点)标注,而不仅仅是边界框。下面是生成的标注的简短版本,以及包含结果形状的相应图像。
我的问题是:
-
集中在
<polygon></polygon>
的内容上,对象检测API是否支持点对点标注? -
如果对1的回答是肯定的,我该如何为其创建TFRecords?还需要做哪些其他更改来适应这一点?
Pascal VOC格式
<annotation verified="no"> <folder>VOC2012</folder> <filename>pic.jpg</filename> <source> <database>Unknown</database> </source> <size> <width>214</width> <height>300</height> <depth>3</depth> </size> <segmented>0</segmented> <object> <name>sample</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>32</xmin> <ymin>37</ymin> <xmax>180</xmax> <ymax>268</ymax> </bndbox> </object></annotation>
点对点标注的快照
<annotation> <filename>ipad.jpg</filename> <folder>sample</folder> <source> <submittedBy>username</submittedBy> </source> <imagesize> <nrows>450</nrows> <ncols>800</ncols> </imagesize> <object> <name>ipad</name> <deleted>0</deleted><verified>0</verified><occluded>no</occluded> <attributes></attributes> <parts> <hasparts></hasparts> <ispartof></ispartof> </parts> <date>12-Jul-2017 19:20:22</date><id>0</id> <polygon> <username>anonymous</username> <pt><x>40</x><y>76</y></pt> <pt><x>435</x><y>11</y></pt> <pt><x>472</x><y>311</y></pt> <pt><x>94</x><y>418</y></pt> </polygon> </object> <object> <name>screen</name> <deleted>0</deleted> <verified>0</verified> <occluded>no</occluded> <attributes></attributes> <parts> <hasparts></hasparts> <ispartof></ispartof> </parts> <date>12-Jul-2017 19:20:48</date><id>1</id> <polygon> <username>anonymous</username> <pt><x>75</x><y>89</y></pt> <pt><x>118</x><y>397</y></pt> <pt><x>447</x><y>308</y></pt> <pt><x>421</x><y>30</y></pt> </polygon> </object></annotation>
回答:
TensorFlow对象检测API仅执行边界框标注。