【发布时间】:2021-06-20 20:02:05
【问题描述】:
我在“test”文件夹中有一堆图像,我在一个文件中有一个 python 代码来显示这些图像。这是代码
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")
这是我在 ubuntu 终端中运行 python 文件时的输出。
我没有打开其他选项卡来显示图像图像。我在堆栈溢出中尝试了其他答案,但没有奏效。但是,这些图像在 colab 的输出中是可见的。
【问题讨论】:
-
这篇文章可能对stackoverflow.com/a/52627121/13273054有帮助
-
@WaveShaper 我看过那篇文章,但对我没有帮助。当我在终端中运行它时,我可以在 colab 的输出中看到图像,但在 ubuntu 中看不到。
标签: python image ubuntu ipython display