Example #1
0
def test_data_disk_loader_with_multiplier_ops_between(tmpdir):
    cache_dir = _prepare_dir(tmpdir)
    src = SourceTest({
        'samples-dir': str(tmpdir),
        'test-split': 2,
        'val-split': 2
    })
    data = Data(input=src,
                cache_dir=cache_dir,
                ops=[AugmentOperation(variants=2)],
                cache_input='disk',
                cache_output=False)
    _test_data_read_samples_x2_between(data)
Example #2
0
def test_data_mem_out_loader_with_multiplier_ops(tmpdir):
    cache_dir = _prepare_dir(tmpdir)
    src = SourceTest({
        'samples-dir': str(tmpdir),
        'test-split': 2,
        'val-split': 2
    })
    data = Data(input=src,
                cache_dir=cache_dir,
                ops=[AugmentOperation(variants=2)],
                cache_input=False,
                cache_output='mem')
    _test_data_read_samples_transformed_x2(data)
Example #3
0
def test_disk_out_loader_with_multiplier_ops_between(tmpdir):
    cache_dir = _prepare_dir(tmpdir)
    st = SourceTest({
        'samples-dir': str(tmpdir),
        'test-split': 2,
        'val-split': 2
    })
    loader = FileCachedLoader(
        cache_dir,
        st,
        ops=[AugmentOperation(variants=2),
             AppendStringOperation()],
        output=st)
    _test_loader_read_samples_x2_between(loader)
Example #4
0
def test_mem_loader_with_multiplier_ops(tmpdir):
    cache_dir = _prepare_dir(tmpdir)
    st = SourceTest({
        'samples-dir': str(tmpdir),
        'test-split': 2,
        'val-split': 2
    })
    loader = MemoryCachedLoader(cache_dir, st)
    loader2 = LiveLoader(
        cache_dir,
        loader,
        ops=[AugmentOperation(variants=2),
             AppendStringOperation()],
        output=st)
    _test_loader_read_samples_x2(loader2)