def accimage_loader(path: str) -> Image.Image:
    """Loads an image using the accimage library for faster loading.

    Falls back to PIL loader if accimage fails to load the image.

    Args:
        path: Path to the image file.

    Returns:
        An image loaded either by accimage or PIL in case of failure.
    """
    try:
        import accimage

        return accimage.Image(path)
    except IOError:
        # Potentially a decoding problem, fall back to PIL.Image
        return pil_loader(path)
Loads an image using the accimage library for faster loading.

    Falls back to PIL loader if accimage fails to load the image.

    Args:
        path: Path to the image file.

    Returns:
        An image loaded either by accimage or PIL in case of failure.
    
lightly/data/_image_loaders.py