I have a bunch of images in "test" folder and I have a python code in a file to display those images. Here is the code
import torch
from IPython.display import Image, clear_output
import matplotlib
import glob
import PIL
from IPython.display import Image, display
from io import BytesIO
print("hi")
for imageName in glob.glob('test/images/*.jpg'): #assuming JPG
print("in \n")
display(Image(filename=imageName)) #displaying successfully in colab
print("out")
print("\n")
and here is the output when I ran the python file in ubuntu terminal.
I have no other tab opened to display image the image. I tried other answers in stack overflow but didn't work. However, the images are visible in colab's output.