[英]What's the best way to load a lot of images from multiple directories?
I currently use a really long and sloppy bit of code using for X in range(len(os.listdir(...))
. 我目前使用相当长且草率的代码for X in range(len(os.listdir(...))
I typically use multiple directories to store images, so how could I load images faster? 我通常使用多个目录来存储图像,那么如何才能更快地加载图像?
If I were you, I would investigate the multiprocessing module. 如果我是你,我将研究多处理模块。 Perhaps you could use it to load and process multiple images at once? 也许您可以使用它来一次加载和处理多个图像?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.