Exemplo n.º 1
0
def test_tile_overlap(n_depth, kern_size):
    K.clear_session()
    img_size = 1280
    rf_x, rf_y = receptive_field_unet(n_depth, kern_size, 2, img_size)
    assert rf_x == rf_y
    rf = rf_x
    assert np.abs(rf[0] - rf[1]) < 10
    assert sum(rf) + 1 < img_size
    assert max(rf) == tile_overlap(n_depth, kern_size)
Exemplo n.º 2
0
def test_tile_overlap():
    n_depths = (1, 2, 3, 4, 5)
    n_kernel = (3, 5, 7)
    img_size = 1280
    for k in n_kernel:
        for n in n_depths:
            K.clear_session()
            rf_x, rf_y = receptive_field_unet(n, k, 2, img_size)
            assert rf_x == rf_y
            rf = rf_x
            assert np.abs(rf[0] - rf[1]) < 10
            assert sum(rf) + 1 < img_size
            assert max(rf) == tile_overlap(n, k)