def test_bbs_in_bbs(self):
bbs_a = np.array([1, 1, 2.0, 3])
bbs_b = np.array([1, 0, 4, 5])
bbs_c = np.array([0, 0, 2, 2])
assert bbs_in_bbs(bbs_a, bbs_b).all()
assert bbs_in_bbs(bbs_b, bbs_c).any() is not True
assert bbs_in_bbs(bbs_a, bbs_c).any() is not True
bbs_d = np.array([
[0, 0, 5, 5],
[1, 2, 4, 4],
[2, 3, 4, 5]
])
assert (bbs_in_bbs(bbs_a, bbs_d) == np.array([1, 0, 0], dtype=np.bool)).all()
assert (bbs_in_bbs(bbs_d, bbs_d) == np.ones((3), dtype=np.bool)).all()
bbs_a *= 100
bbs_d *= 100
assert (bbs_in_bbs(bbs_a, bbs_d) == np.array([1, 0, 0], dtype=np.bool)).all()
评论列表
文章目录