Esempio n. 1
0
def test_image_mask_generator_random_rotations_zoom():

    gen = ImageMaskGenerator(pipeline=('random_transform', ),
                             rotation_range=90.,
                             zoom_range=0.5,
                             data_format='channels_first')
    _test_image_mask_generator(gen)
Esempio n. 2
0
def test_image_mask_generator_with_fit():

    gen = ImageMaskGenerator(featurewise_center=True,
                             featurewise_std_normalization=True,
                             data_format='channels_first')
    _test_image_mask_generator_with_fit(gen, augment=False)
    _test_image_mask_generator_with_fit(gen, augment=True)
Esempio n. 3
0
def test_image_mask_generator_random_rotations_zoom_shift_shear():

    gen = ImageMaskGenerator(pipeline=('random_transform', ),
                             rotation_range=90.,
                             zoom_range=0.5,
                             width_shift_range=0.2,
                             height_shift_range=0.2,
                             shear_range=3.14 / 6.0,
                             data_format='channels_first')
    _test_image_mask_generator(gen)
Esempio n. 4
0
def test_image_mask_generator_invalid_data():

    # Test invalid pipeline
    with pytest.raises(AssertionError):
        ImageMaskGenerator(pipeline=(),
                           rotation_range=90.,
                           zoom_range=0.5,
                           width_shift_range=0.2,
                           height_shift_range=0.2,
                           shear_range=3.14 / 6.0,
                           horizontal_flip=True,
                           vertical_flip=True)
    with pytest.raises(AssertionError):
        ImageMaskGenerator(pipeline=('blabla', ),
                           rotation_range=90.,
                           zoom_range=0.5,
                           width_shift_range=0.2,
                           height_shift_range=0.2,
                           shear_range=3.14 / 6.0,
                           horizontal_flip=True,
                           vertical_flip=True)
Esempio n. 5
0
def test_image_mask_generator_all_random_transformations():

    # Ignore channel_shift_range where only image is transformed
    gen = ImageMaskGenerator(pipeline=('random_transform', 'standardize'),
                             rotation_range=90.,
                             zoom_range=0.5,
                             width_shift_range=0.2,
                             height_shift_range=0.2,
                             shear_range=3.14 / 6.0,
                             horizontal_flip=True,
                             vertical_flip=True,
                             data_format='channels_first')
    _test_image_mask_generator(gen)
Esempio n. 6
0
def test_image_mask_generator_basic():

    gen = ImageMaskGenerator(data_format='channels_first')
    _test_image_mask_generator(gen)