小编Paz*_*fro的帖子

如何在 Tensorflow Object Detection API 中找到边界框坐标

我正在使用 Tensorflow 对象检测 API 代码。我训练了我的模型并获得了很好的检测百分比。我一直在尝试获取边界框坐标,但它一直在打印出 100 个奇异数组的列表。

在网上广泛搜索后,我发现了数组中的数字的含义(边界框坐标相对于底层图像的宽度和高度在 [0.0, 1.0] 中浮动。)但是,我的数组与在线示例中显示的那些。另一个奇怪的事情是我用少于 100 张图像测试了我的模块,所以怎么会有 100 个边界框坐标的数据。

我得到的数组;

 [[3.13721418e-01 4.65148419e-01 7.11575747e-01 6.85783863e-01]
 [9.78936195e-01 6.50490820e-03 9.97096300e-01 1.82596639e-01]
 [9.51383412e-01 0.00000000e+00 1.00000000e+00 3.88432704e-02]
 [9.85813320e-01 8.96016136e-02 9.97273505e-01 3.15960884e-01]
 [9.88873005e-01 2.13812709e-01 1.00000000e+00 4.14675951e-01]

 ......
 [4.42647263e-02 9.90755498e-01 2.57772505e-01 1.00000000e+00]
 [2.69711018e-05 5.21758199e-02 6.37509704e-01 6.62899792e-01]
 [0.00000000e+00 3.00989419e-01 9.92376506e-02 1.00000000e+00]
 [1.87531322e-01 2.66501214e-04 4.50700432e-01 1.23927500e-02]
 [9.36755657e-01 4.61095899e-01 9.92406607e-01 7.62619019e-01]]
Run Code Online (Sandbox Code Playgroud)

进行检测并获取边界框坐标的函数。output_dict['detection_boxes'] 是保存上面数组的地方。

def run_inference_for_single_image(image, graph):
  with graph.as_default():
    with tf.Session() as sess:
      # Get handles to input and output tensors
      ops = tf.get_default_graph().get_operations()
      all_tensor_names …
Run Code Online (Sandbox Code Playgroud)

bounding-box object-detection coordinates tensorflow

4
推荐指数
1
解决办法
5315
查看次数