Skip to content

imagenette

imagenette_dataset(tmp_path)

Generate a mock imagenette dataset to test efficient_ad model

Parameters:

  • tmp_path (Path) –

    Path to temporary directory

  • request

    Pytest SubRequest object

Source code in quadra/utils/tests/fixtures/dataset/imagenette.py
40
41
42
43
44
45
46
47
48
49
50
51
52
53
@pytest.fixture
def imagenette_dataset(tmp_path: Path) -> str:
    """Generate a mock imagenette dataset to test efficient_ad model

    Args:
        tmp_path: Path to temporary directory
        request: Pytest SubRequest object
    Yields:
        Path to imagenette dataset folder
    """
    yield _build_imagenette_dataset(tmp_path, classes=3, class_samples=3)

    if tmp_path.exists():
        shutil.rmtree(tmp_path)