test_non_maximum_suppression.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:chainercv 作者: chainer 项目源码 文件源码
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))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号