def apply_transform_without_normalize(
    image: Image.Image,
    transform,
) -> Image.Image:
    """Applies the transform to the image but skips ToTensor and Normalize.

    Args:
        image:
            The input PIL image.
        transform:
            The transformation to apply, excluding ToTensor and Normalize.

    Returns:
        The transformed image.
    """
    skippable_transforms = (
        torchvision.transforms.ToTensor,
        torchvision.transforms.Normalize,
    )
    if isinstance(transform, torchvision.transforms.Compose):
        for transform_ in transform.transforms:
            image = apply_transform_without_normalize(image, transform_)
    elif not isinstance(transform, skippable_transforms):
        image = transform(image)
    return image
Applies the transform to the image but skips ToTensor and Normalize.

    Args:
        image:
            The input PIL image.
        transform:
            The transformation to apply, excluding ToTensor and Normalize.

    Returns:
        The transformed image.
    
lightly/utils/debug.py