def test_simple_filter(self):
input_annotations_group = [
np.array([
[ 0, 0, 10, 10],
[150, 150, 50, 50]
]),
]
input_image = np.zeros((500, 500, 3))
expected_annotations_group = [
np.array([
[0, 0, 10, 10],
]),
]
simple_generator = SimpleGenerator(input_annotations_group)
annotations_group = simple_generator.load_annotations_group(simple_generator.groups[0])
# expect a UserWarning
with pytest.warns(UserWarning):
image_group, annotations_group = simple_generator.filter_annotations([input_image], annotations_group, simple_generator.groups[0])
np.testing.assert_equal(expected_annotations_group, annotations_group)
评论列表
文章目录