首页 > 解决方案 > 如何为视网膜网络训练准备我的图像和注释?

问题描述

我按照本教程在 coco 数据集上训练对象检测模型。本教程包含一个下载和使用coco 数据集及其注释并将它们转换为TFRecord的步骤。

我需要使用自己的自定义数据进行训练,我使用labelimg工具进行了注释,该工具生成了包含 (w,h,xmin,ymin,xmax,ymax) 的图像的 xml 文件。

但是coco 数据集具有 JSON格式,带有用于创建TFRecord的图像分割字段。

训练 resnet、retinanet 是否必须进行分段?

那么,任何人都可以指导我从没有分段值的 XML 注释创建 JSON 注释的过程吗?

xml:

<annotation>
    <folder>frames</folder>
    <filename>83.jpg</filename>
    <path>/home/tdadmin/Downloads/large/f/frames/83.jpg</path>
    <source>
        <database>Unknown</database>
    </source>
    <size>
        <width>640</width>
        <height>480</height>
        <depth>3</depth>
    </size>
    <segmented>0</segmented>
    <object>
        <name>person</name>
        <pose>Unspecified</pose>
        <truncated>0</truncated>
        <difficult>0</difficult>
        <bndbox>
            <xmin>246</xmin>
            <ymin>48</ymin>
            <xmax>350</xmax>
            <ymax>165</ymax>
        </bndbox>
    </object>
</annotation>

标签: image-processingartificial-intelligenceobject-detectionobject-detection-apiretinanet

解决方案


你现在做的有点像我之前做过的一个项目。所以我有一些建议给你。

当我训练我的 Mask RCNN 模型时,我使用了 VGG Image Annotator(你可以在 Google 上轻松找到它)。通过使用该工具,可以轻松创建 json 注释文件。然后将其插入您的训练中。

希望对您有所帮助。如果您仍有疑问,请随时对此发表评论。

罗文


推荐阅读