def default_loader(path: str) -> Image.Image:
    """Loads an image using the default backend specified in torchvision.

    Uses accimage if available and configured as the backend, otherwise falls back to PIL.

    Args:
        path: Path to the image file.

    Returns:
        An image loaded by either accimage or PIL depending on the backend.
    """
    from torchvision import get_image_backend

    if get_image_backend() == "accimage":
        return accimage_loader(path)
    else:
        return pil_loader(path)
Loads an image using the default backend specified in torchvision.

    Uses accimage if available and configured as the backend, otherwise falls back to PIL.

    Args:
        path: Path to the image file.

    Returns:
        An image loaded by either accimage or PIL depending on the backend.
    
lightly/data/_image_loaders.py