本文整理汇总了Python中object_detection.core.box_list_ops.height_width方法的典型用法代码示例。如果您正苦于以下问题:Python box_list_ops.height_width方法的具体用法?Python box_list_ops.height_width怎么用?Python box_list_ops.height_width使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object_detection.core.box_list_ops
的用法示例。
在下文中一共展示了box_list_ops.height_width方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_height_width
# 需要导入模块: from object_detection.core import box_list_ops [as 别名]
# 或者: from object_detection.core.box_list_ops import height_width [as 别名]
def test_height_width(self):
corners = tf.constant([[0.0, 0.0, 10.0, 20.0], [1.0, 2.0, 3.0, 4.0]])
exp_output_heights = [10., 2.]
exp_output_widths = [20., 2.]
boxes = box_list.BoxList(corners)
heights, widths = box_list_ops.height_width(boxes)
with self.test_session() as sess:
output_heights, output_widths = sess.run([heights, widths])
self.assertAllClose(output_heights, exp_output_heights)
self.assertAllClose(output_widths, exp_output_widths)
示例2: test_height_width
# 需要导入模块: from object_detection.core import box_list_ops [as 别名]
# 或者: from object_detection.core.box_list_ops import height_width [as 别名]
def test_height_width(self):
corners = tf.constant([[0.0, 0.0, 10.0, 20.0], [1.0, 2.0, 3.0, 4.0]])
exp_output_heights = [10., 2.]
exp_output_widths = [20., 2.]
boxes = box_list.BoxList(corners)
heights, widths = box_list_ops.height_width(boxes)
with self.test_session() as sess:
output_heights, output_widths = sess.run([heights, widths])
self.assertAllClose(output_heights, exp_output_heights)
self.assertAllClose(output_widths, exp_output_widths)
示例3: test_height_width
# 需要导入模块: from object_detection.core import box_list_ops [as 别名]
# 或者: from object_detection.core.box_list_ops import height_width [as 别名]
def test_height_width(self):
def graph_fn():
corners = tf.constant([[0.0, 0.0, 10.0, 20.0], [1.0, 2.0, 3.0, 4.0]])
boxes = box_list.BoxList(corners)
return box_list_ops.height_width(boxes)
heights_out, widths_out = self.execute(graph_fn, [])
exp_output_heights = [10., 2.]
exp_output_widths = [20., 2.]
self.assertAllClose(heights_out, exp_output_heights)
self.assertAllClose(widths_out, exp_output_widths)