def test_load_image_from_disk_red(): filename = 'red.png' path = SAMPLE_DATA_DIR / filename actual_image = load_image_from_disk(path)[:, :, :3] expected_image = np.zeros((32, 32, 3), dtype='uint8') expected_image[:, :, 0] = 255 np.testing.assert_equal(actual_image, expected_image)
def wildebeest_gray_local(): filename = 'wildebeest_gray.jpg' path = SAMPLE_DATA_DIR / filename return load_image_from_disk(path)
def wildebeest_rgba_local(): filename = 'wildebeest_rgba.png' path = SAMPLE_DATA_DIR / filename return load_image_from_disk(path)
def sample_image_square_rgb_rotated_180(): filename = 'wildebeest_rgb_rotated_180.jpg' path = SAMPLE_DATA_DIR / filename return load_image_from_disk(path)
def sample_image_tall_grayscale_rotated_180(): filename = 'wildebeest_gray_rotated_180.jpg' path = SAMPLE_DATA_DIR / filename return load_image_from_disk(path)
def sample_image_grayscale_flipped_vert(): filename = 'wildebeest_gray_flipped_vert.jpg' path = SAMPLE_DATA_DIR / filename return load_image_from_disk(path)
def sample_image_square_rgb_flipped_horiz(): filename = 'wildebeest_rgb_flipped_horiz.jpg' path = SAMPLE_DATA_DIR / filename return load_image_from_disk(path)
def sample_image_square_rgba_flipped_vert(): filename = 'wildebeest_rgba_flipped_vert.png' path = SAMPLE_DATA_DIR / filename return load_image_from_disk(path)