tensorflow - 用于对象检测 API tensorflow 的归一化标签框
问题描述
当我使用 labelImg ( https://github.com/tzutalin/labelImg ) 在我的对象周围绘制边界框以输出 annotation.xml 文件时,它会给出边界框的坐标。我使用这些注释来输入 tensorflow 中的对象检测模型(ssd_mobilenet_v1_coco & faster_rcnn_resnet101_coco)。预测的输出 (xmin, ymin, xmax, ymax) 是从 0 - 1。
我的 annotation.xml 中的输入是否标准化为 0 - 1?我想知道这一点,因为我想通过将基本事实和预测边界框输入到我自己的 IOU 函数中来获得 IOU。谢谢你
解决方案
基本上,如果您为模型提供 tf.record 文件,它包含您的图像和边界框的标准化坐标。因此,您从 .xml 文件转换为 tf.record 文件也会标准化您的边界框坐标。
您的模型的输出也将采用标准化坐标。您可以通过乘以图像大小轻松地重新缩放它们:
x_min_abs = x_min_rel * image_width
x_max_abs = x_max_rel * image_width
y_min_abs = y_min_rel * image_height
y_max_abs = y_max_rel * image_height
推荐阅读
- javascript - 如何使用 Turn.js 将 filp 效果添加到 epub 页面?
- solr - 使用 gremlin cli 连接到 apache atlas + hbase + solr setup
- mysql - 通过使用 django ORM 查询获取模型对象的所有相关细节?
- php - 非常高级的mysql搜索
- c# - Moq 插入/更新新对象初始化
- html - 无法在固定位置 div 下方使用滚动条
- php - Magento 2.3.2 - 单击使用贝宝快速结帐付款时删除自定义属性地址
- linux - 如何通过 RDP 访问 Azure Linux 虚拟机
- python - pandas.groubpy.apply 执行了太多次?
- jenkins - 条件步骤(多个) - Jenkins 中的量角器分片直到最后一步才运行