python - 如何获取坐标?(tensorflow标签模型物体检测)
问题描述
大家好,有人可以帮帮我吗?
我想知道矩形坐标
是否需要使用“盒子”?以及如何让 tensorflow 知道哪个是矩形坐标?
以下是对的吗?它需要是int吗?x_left = 1280*(np.squeeze(boxes[0,0,1]))
y_left = 640 *(np.squeeze(boxes[0,0,0]))
x_right = 1280*(np.squeeze(boxes[0,0,3]))
y_right = 640 *(np.squeeze(boxes[0,0,2])) ------------------------------- -----------------------------------是否需要为int?
x_left = int(round(x_left))
y_left = int(round(y_left))
x_right = int(圆形(x_right))
y_right = #int(圆形(y_right))
解决方案
boxes
是归一化坐标的数组。数组的长度boxes
等于检测的数量。对于索引i
,
boxes[i]=[x_left, y_left, x_right, y_right],
其中x_left
, y_left
, x_right
,y_right
在区间 [0,1] 内。
如果输入模型的图像是高度H
和宽度W
的,那么盒子的坐标是
x_left = int(W*x_left)
y_left = int(H*y_left)
x_right = int(W*x_right)
y_right = int(H*y_right).
推荐阅读
- java - 将所有测试项目设置为并行 SpringBoot 和 junit 后并发修改异常
- javascript - JQuery 屏蔽输入在 Rails 6 中不起作用
- android - 有没有办法检测 process_vm_readv() 调用?
- c++ - c++中内存是如何释放的
- c - 制作 m 个节点的列表,其中 m 是输入
- django - 使用 Django 仅更新 HTML 页面的一部分
- java - 嵌入式设备上的 JavaFX BufferOverflowException
- json - 从确切的 JSONpath 级别获取值
- python-3.x - 如何从 Azure Data Lake Gen2 访问 XML 文件并将其转换为 Azure Databricks 中的数据框?
- tabulator - Tabulator 4.5 从 api 获取数据但不使用数据渲染表格