def plot_img(img: Union[str, PosixPath, Image, list], title: str = None):
    """
    Plot one image in notebook.

    Args:
        img (`Union[str, PosixPath, Image]`):
            Image to plot.
        title (`str`):
            Title of the image to show.
    """
    if isinstance(img, list):
        plot_img_list(img, title)
    else:
        if isinstance(img, Union[str, PosixPath].__args__):
            img = from_src(img)
        _, ax = plt.subplots(1, 1, figsize=(5, 5))
        try:
            ax.imshow(img.to_ndarray())
        except: # pylint: disable=bare-except
            ax.imshow(to_image_color(img, 'RGB'))
        ax.axis('off')
        if title:
            ax.set_title(f'{title:.04f}\n')
Plot one image in notebook.

Args:
img (`Union[str, PosixPath, Image]`):
Image to plot.
title (`str`):
Title of the image to show.
towhee/utils/matplotlib_utils.py