本文整理汇总了Python中object_detection.utils.ops.filter_groundtruth_with_crowd_boxes方法的典型用法代码示例。如果您正苦于以下问题:Python ops.filter_groundtruth_with_crowd_boxes方法的具体用法?Python ops.filter_groundtruth_with_crowd_boxes怎么用?Python ops.filter_groundtruth_with_crowd_boxes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object_detection.utils.ops
的用法示例。
在下文中一共展示了ops.filter_groundtruth_with_crowd_boxes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_filter_groundtruth_with_crowd_boxes
# 需要导入模块: from object_detection.utils import ops [as 别名]
# 或者: from object_detection.utils.ops import filter_groundtruth_with_crowd_boxes [as 别名]
def test_filter_groundtruth_with_crowd_boxes(self):
input_tensors = {
fields.InputDataFields.groundtruth_boxes:
[[0.1, 0.2, 0.6, 0.8], [0.2, 0.4, 0.1, 0.8]],
fields.InputDataFields.groundtruth_classes:
[1, 2],
fields.InputDataFields.groundtruth_is_crowd:
[True, False],
fields.InputDataFields.groundtruth_area:
[100.0, 238.7]
}
expected_tensors = {
fields.InputDataFields.groundtruth_boxes:
[[0.2, 0.4, 0.1, 0.8]],
fields.InputDataFields.groundtruth_classes:
[2],
fields.InputDataFields.groundtruth_is_crowd:
[False],
fields.InputDataFields.groundtruth_area:
[238.7]
}
output_tensors = ops.filter_groundtruth_with_crowd_boxes(
input_tensors)
with self.test_session() as sess:
output_tensors = sess.run(output_tensors)
for key in [fields.InputDataFields.groundtruth_boxes,
fields.InputDataFields.groundtruth_area]:
self.assertAllClose(expected_tensors[key], output_tensors[key])
for key in [fields.InputDataFields.groundtruth_classes,
fields.InputDataFields.groundtruth_is_crowd]:
self.assertAllEqual(expected_tensors[key], output_tensors[key])
示例2: test_filter_groundtruth_with_crowd_boxes
# 需要导入模块: from object_detection.utils import ops [as 别名]
# 或者: from object_detection.utils.ops import filter_groundtruth_with_crowd_boxes [as 别名]
def test_filter_groundtruth_with_crowd_boxes(self):
input_tensors = {
fields.InputDataFields.groundtruth_boxes:
[[0.1, 0.2, 0.6, 0.8], [0.2, 0.4, 0.1, 0.8]],
fields.InputDataFields.groundtruth_classes: [1, 2],
fields.InputDataFields.groundtruth_is_crowd: [True, False],
fields.InputDataFields.groundtruth_area: [100.0, 238.7],
fields.InputDataFields.groundtruth_confidences: [0.5, 0.99],
}
expected_tensors = {
fields.InputDataFields.groundtruth_boxes: [[0.2, 0.4, 0.1, 0.8]],
fields.InputDataFields.groundtruth_classes: [2],
fields.InputDataFields.groundtruth_is_crowd: [False],
fields.InputDataFields.groundtruth_area: [238.7],
fields.InputDataFields.groundtruth_confidences: [0.99],
}
output_tensors = ops.filter_groundtruth_with_crowd_boxes(
input_tensors)
with self.test_session() as sess:
output_tensors = sess.run(output_tensors)
for key in [fields.InputDataFields.groundtruth_boxes,
fields.InputDataFields.groundtruth_area,
fields.InputDataFields.groundtruth_confidences]:
self.assertAllClose(expected_tensors[key], output_tensors[key])
for key in [fields.InputDataFields.groundtruth_classes,
fields.InputDataFields.groundtruth_is_crowd]:
self.assertAllEqual(expected_tensors[key], output_tensors[key])
开发者ID:ShivangShekhar,项目名称:Live-feed-object-device-identification-using-Tensorflow-and-OpenCV,代码行数:31,代码来源:ops_test.py
示例3: test_filter_groundtruth_with_crowd_boxes
# 需要导入模块: from object_detection.utils import ops [as 别名]
# 或者: from object_detection.utils.ops import filter_groundtruth_with_crowd_boxes [as 别名]
def test_filter_groundtruth_with_crowd_boxes(self):
input_tensors = {
fields.InputDataFields.groundtruth_boxes:
[[0.1, 0.2, 0.6, 0.8], [0.2, 0.4, 0.1, 0.8]],
fields.InputDataFields.groundtruth_classes:
[1, 2],
fields.InputDataFields.groundtruth_is_crowd:
[True, False],
fields.InputDataFields.groundtruth_area:
[100.0, 238.7]
}
expected_tensors = {
fields.InputDataFields.groundtruth_boxes:
[[0.2, 0.4, 0.1, 0.8]],
fields.InputDataFields.groundtruth_classes:
[2],
fields.InputDataFields.groundtruth_is_crowd:
[False],
fields.InputDataFields.groundtruth_area:
[238.7]
}
output_tensors = ops.filter_groundtruth_with_crowd_boxes(
input_tensors)
with self.test_session() as sess:
output_tensors = sess.run(output_tensors)
for key in [fields.InputDataFields.groundtruth_boxes,
fields.InputDataFields.groundtruth_area]:
self.assertAllClose(expected_tensors[key], output_tensors[key])
for key in [fields.InputDataFields.groundtruth_classes,
fields.InputDataFields.groundtruth_is_crowd]:
self.assertAllEqual(expected_tensors[key], output_tensors[key])
示例4: test_filter_groundtruth_with_crowd_boxes
# 需要导入模块: from object_detection.utils import ops [as 别名]
# 或者: from object_detection.utils.ops import filter_groundtruth_with_crowd_boxes [as 别名]
def test_filter_groundtruth_with_crowd_boxes(self):
def graph_fn():
input_tensors = {
fields.InputDataFields.groundtruth_boxes:
[[0.1, 0.2, 0.6, 0.8], [0.2, 0.4, 0.1, 0.8]],
fields.InputDataFields.groundtruth_classes: [1, 2],
fields.InputDataFields.groundtruth_is_crowd: [True, False],
fields.InputDataFields.groundtruth_area: [100.0, 238.7],
fields.InputDataFields.groundtruth_confidences: [0.5, 0.99],
}
output_tensors = ops.filter_groundtruth_with_crowd_boxes(
input_tensors)
return output_tensors
expected_tensors = {
fields.InputDataFields.groundtruth_boxes: [[0.2, 0.4, 0.1, 0.8]],
fields.InputDataFields.groundtruth_classes: [2],
fields.InputDataFields.groundtruth_is_crowd: [False],
fields.InputDataFields.groundtruth_area: [238.7],
fields.InputDataFields.groundtruth_confidences: [0.99],
}
output_tensors = self.execute(graph_fn, [])
for key in [fields.InputDataFields.groundtruth_boxes,
fields.InputDataFields.groundtruth_area,
fields.InputDataFields.groundtruth_confidences]:
self.assertAllClose(expected_tensors[key], output_tensors[key])
for key in [fields.InputDataFields.groundtruth_classes,
fields.InputDataFields.groundtruth_is_crowd]:
self.assertAllEqual(expected_tensors[key], output_tensors[key])