【发布时间】:2020-07-22 00:49:13
【问题描述】:
我想使用部分代码来更改我的输入图像大小,但 imresize 在 scipy 上已被弃用,并且无法在 google colab 上运行。部分代码为:
height = 256
width = 256
channels = 3
.....
img = sc.imread(Tr_list[idx])
img = np.double(sc.imresize(img, [height, width, channels], interp='bilinear', mode = 'RGB'))
所以,我正在寻找 numpy.array(Image.fromarray(arr).resize()) 上的等效代码。我应该如何更改我的代码?
确切的错误文本是:
AttributeError: module 'scipy.misc' has no attribute 'imread'
【问题讨论】:
-
请使用准确且完整的错误跟踪更新您的帖子。另外,既然您询问
numpy,您应该包括标签(已编辑)。
标签: python numpy image-processing scipy