[英]Scipy.misc.imread() is depriciated
I'm working on a project and I'm referring this particular repository which have used scipy.misc我正在做一个项目,我指的是这个使用 scipy.misc 的特定存储库
The line of code which I'm trying to replace:我试图替换的代码行:
scipy.misc.imresize(scipy.misc.imread(image), (128, 256))
where image is the file location scipy.misc.imresize(scipy.misc.imread(image), (128, 256))
其中image是文件位置
The alternative approaches which I've tried are:我尝试过的替代方法是:
np.array(Image.fromarray(image).resize((128,256)))
cv2.resize(cv2.imread(image,0), (256, 128))
but nothing worked.但没有任何效果。 Can anyone please help me out in this?谁能帮我解决这个问题?
Try imageio and scikit-image试试 imageio 和 scikit-image
import imageio
from skimage import transform
img = imageio.imread(path_to_img)
img = transform.resize(img, (128, 256))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.