def testRuleBasedDispatcherNoLabels(self):
# prepare data for test
box1 = box(0, 0, 100, 100)
box2 = box(0, 0, 10, 10)
dispatcher = RuleBasedDispatcher([CatchAllRule()])
self.assertEqual(dispatcher.dispatch(None, box1), 0)
dispatch_batch = dispatcher.dispatch_batch(None, [box1, box2])
assert_array_equal(dispatch_batch, [0, 0])
labels, dispatch_map = dispatcher.dispatch_map(None, [box1, box2])
assert_array_equal(labels, dispatch_batch)
assert_array_equal(dispatch_batch, dispatch_map)
评论列表
文章目录