def test_imagaug_flipud_transform_bboxes(image): aug = IAAFlipud(p=1) mask = np.copy(image) dummy_class = 1234 bboxes = [(10, 10, 20, 20, dummy_class), (20, 10, 30, 40, dummy_class)] expect = [(10, 79, 20, 89, dummy_class), (20, 59, 30, 89, dummy_class)] bboxes = convert_bboxes_to_albumentations(bboxes, 'pascal_voc', rows=image.shape[0], cols=image.shape[1]) data = aug(image=image, mask=mask, bboxes=bboxes) actual = convert_bboxes_from_albumentations(data['bboxes'], 'pascal_voc', rows=image.shape[0], cols=image.shape[1]) assert np.array_equal(data['image'], data['mask']) assert np.allclose(actual, expect)
def test_imports_from_imgaug_module_dont_raise_import_error(): from albumentations.imgaug.transforms import IAAFlipud IAAFlipud()