def plot_augmented_images(
    input_images: List[Image.Image],
    collate_function: Union[BaseCollateFunction, MultiViewCollateFunction],
):
    """Plots original images and augmented images in a figure.

    This function ignores the ToTensor and Normalize transforms for visualization purposes.

    Args:
        input_images:
            List of PIL images for which the augmentations should be plotted.
        collate_function:
            The collate function of the self-supervised learning algorithm.
            Must be of type BaseCollateFunction or MultiViewCollateFunction.

    Returns:
        A figure showing the original images in the left column and the augmented
        images to their right. If the collate_function is an instance of the
        BaseCollateFunction, two example augmentations are shown. For
        MultiViewCollateFunctions all the generated views are shown.

    """
    _check_matplotlib_available()

    if len(input_images) == 0:
        raise ValueError("There must be at least one input image.")

    grid = generate_grid_of_augmented_images(input_images, collate_function)
    grid.insert(0, input_images)
    nrows = len(input_images)
    ncols = len(grid)

    fig, axs = plt.subplots(nrows, ncols, figsize=(ncols * 1.5, nrows * 1.5))

    for i in range(nrows):
        for j in range(ncols):
            ax = axs[i][j] if len(input_images) > 1 else axs[j]
            img = grid[j][i]
            ax.imshow(img)
            ax.set_axis_off()

    ax_top_left = axs[0, 0] if len(input_images) > 1 else axs[0]
    ax_top_left.set(title="Original images")
    ax_top_left.title.set_size(8)
    ax_top_next = axs[0, 1] if len(input_images) > 1 else axs[1]
    ax_top_next.set(title="Augmented images")
    ax_top_next.title.set_size(8)
    fig.tight_layout()

    return fig
Plots original images and augmented images in a figure.

    This function ignores the ToTensor and Normalize transforms for visualization purposes.

    Args:
        input_images:
            List of PIL images for which the augmentations should be plotted.
        collate_function:
            The collate function of the self-supervised learning algorithm.
            Must be of type BaseCollateFunction or MultiViewCollateFunction.

    Returns:
        A figure showing the original images in the left column and the augmented
        images to their right. If the collate_function is an instance of the
        BaseCollateFunction, two example augmentations are shown. For
        MultiViewCollateFunctions all the generated views are shown.

    
lightly/utils/debug.py