def imshow(img, ax=None):
    if ax is None:
        fig = plt.figure()
        ax = fig.add_subplot(111)
    prm = dict(interpolation='none')
    if img.ndim==2 or img.shape[2]==1:
        prm['cmap']=plt.cm.gray
        if img.ndim > 2:
            img = img[:,:,0]
    img -= img.min()
    img /= img.max()
    ax.imshow(img, **prm)
    ax.get_xaxis().set_visible(False)
    ax.get_yaxis().set_visible(False)
Displays an image, taking care of rescaling it and taking care of gray versus color.
dataset/ETHPy150Open bbabenko/simple_convnet/simple_convnet/helpers.py/imshow