在没有边界框注释的情况下训练 Tensorflow 对象检测

Train Tensorflow Obejct Detection without bounding boxes annotations

我设法在我自己的数据集上重新训练 ,方法是将其遵循如下所示的 PASCAL VOC 格式。

这种格式是 边界框 导向并窥视他们的 TFRecords creation scripts,它确实期望有很多 groundtruth生成相应 TFRecords 的值。

边界框的问题是它给你近似值,并且注释旋转图像可能相当具有挑战性。

环顾四周后,我遇到了 labelme,它允许您执行形状(点对点)注释,而不仅仅是边界框。下面是生成的注释的简短版本以及由生成的形状组成的生成图像。

我的问题是:

  1. 关注<polygon></polygon>的内容,Object Detection API是否支持点对点标注?

  2. 如果对 1 的回答是“是”,我该如何为它创建 TFRecords?还需要进行哪些其他更改才能适应这种情况?

帕斯卡 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>

点对点标注快照

Here's the full annotation file and the corresponding image

<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 仅执行边界框注释。