Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
def wildebeest_gray_local():
    filename = 'wildebeest_gray.jpg'
    path = SAMPLE_DATA_DIR / filename
    return load_image_from_disk(path)
Ejemplo n.º 3
0
def wildebeest_rgba_local():
    filename = 'wildebeest_rgba.png'
    path = SAMPLE_DATA_DIR / filename
    return load_image_from_disk(path)
Ejemplo n.º 4
0
def sample_image_square_rgb_rotated_180():
    filename = 'wildebeest_rgb_rotated_180.jpg'
    path = SAMPLE_DATA_DIR / filename
    return load_image_from_disk(path)
Ejemplo n.º 5
0
def sample_image_tall_grayscale_rotated_180():
    filename = 'wildebeest_gray_rotated_180.jpg'
    path = SAMPLE_DATA_DIR / filename
    return load_image_from_disk(path)
Ejemplo n.º 6
0
def sample_image_grayscale_flipped_vert():
    filename = 'wildebeest_gray_flipped_vert.jpg'
    path = SAMPLE_DATA_DIR / filename
    return load_image_from_disk(path)
Ejemplo n.º 7
0
def sample_image_square_rgb_flipped_horiz():
    filename = 'wildebeest_rgb_flipped_horiz.jpg'
    path = SAMPLE_DATA_DIR / filename
    return load_image_from_disk(path)
Ejemplo n.º 8
0
def sample_image_square_rgba_flipped_vert():
    filename = 'wildebeest_rgba_flipped_vert.png'
    path = SAMPLE_DATA_DIR / filename
    return load_image_from_disk(path)