如何从tensorflow中选择边界框的物体检测坐标

问题描述:

我正在尝试使用object_detection from tensorflow library来检测彩色正方形。对于train-eval-dataset中的每个图像,我都应该有关于bounding box coordinates (with origin in top left corner) defined by 4 floating point numbers [ymin, xmin, ymax, xmax]的信息。现在,让我们假设background_image是完全白色图像300 x 300px。我的图像生成的代码看起来是这样的(伪):如何从tensorflow中选择边界框的物体检测坐标

new_image = background_image.copy() 
rand_x, rand_y = random_coordinates(new_image) 
for (i = rand_x; i < rand_y + 100; ++i) 
    for (j = rand_y; j < rand_y + 100; ++j) 
     new_image[i][j] = color(red) 

...所以现在我们有白色背景上的红色正方形100×100像素的300×300像素的图像。问题是 - 如果我的边界框只包含红色像素[rand_x,rand_y,rand_x + 100,rand_y + 100],或者它应该包含像[rand_x - 5,rand_y - 5,rand_x + 105,rand_y + 105]?也许这并不重要?训练15小时和评估后(有边框坐标= [rand_x,rand_y,rand_x + 100,rand_y + 100])tensorboard表明我是这样的:

Tensorboard通知precission约0.1。

我的理解很好,只有1100步后结果不应该令人惊叹。我只想排除由于我的错误而导致的潜在不准确性。

+0

请更新[链接](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/using_your_own_dataset.md) –

+0

谢谢你,链接已更新。 – Vether

理想情况下,你希望你的预测盒完美重叠地面的真相框。

这意味着如果A = [y_min, x_min, y_max, x_max]是地面实况框,您希望B(预测的框)等于A =>A=B

在火车阶段是完全正常的,你的预测是“围绕”地面真相,没有完美的匹配。

实际上,即使在测试阶段(火车末端)A=B也难以实现,因为每个分类器/回归器都不完美。

总之:你的预测看起来不错。随着更多的火车时代,你可能会得到一些更好的结果