def check_non_maximum_suppression_options(
self, bbox, threshold, score, limit):
# Pass all options to the tested function
scored_selec = non_maximum_suppression(bbox, threshold, score, limit)
self.assertIsInstance(scored_selec, type(bbox))
# Reorder inputs befor passing it to the function.
# Reorder the outputs according to scores.
order = score.argsort()[::-1]
reordered_selec = non_maximum_suppression(
bbox[order], threshold, score=None, limit=None)
reordered_selec = reordered_selec[:limit]
reordered_selec = order[reordered_selec]
np.testing.assert_equal(
cuda.to_cpu(scored_selec), cuda.to_cpu(reordered_selec))
评论列表
文章目录