为什么图像没有在 colab 中显示

问题描述 投票:0回答:0

遍历图像路径并在子图中显示每个图像

for i, img_path in enumerate(pneumonia_images): sp = plt.subplot(2, 4, i+1) sp.axis('关闭')

# Read in the image using Matplotlib's imread() function
img = mpimg.imread(img_path)
plt.imshow(img)

以 4x4 的形式显示 16 张图像

plt.show()

我得到这个输出而不是图像

python matplotlib deep-learning artificial-intelligence google-colaboratory
© www.soinside.com 2019 - 2024. All rights reserved.