简体   繁体   English

从多个目录加载大量图像的最佳方法是什么?

[英]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.

相关问题 从函数返回多个值的最佳方法是什么? - What's the best way to return multiple values from a function? 在 S3 目录中读取多个 json 文件然后将它们加载到 MySQL 表的最佳方法是什么? - What is the best way to read multiple json files in a S3 directory and then load them to a MySQL table? 加载图像的最佳方式 pygame - Best way to load images pygame 在python中集中裁剪图像的最佳方法是什么? - What's the best way of centre cropping images in python? 在Python中加载大型JSON列表的最佳方法是什么? - What's the best way to load large JSON lists in Python? 什么是清除CSV并加载到mysql的最佳方法 - what's the best way to clean CSV and load to mysql 允许用户从多个函数中选择要在Python中运行的最佳方法是什么? - What's the best way to allow a user to select from multiple functions to run in Python? 在多个Python进程之间共享字典的最佳方法是什么? - What's the best way to share a dictionary between multiple Python processes? 在Python 3中安排和管理多个进程的最佳方法是什么 - What's the Best Way to Schedule and Manage Multiple Processes in Python 3 将不同的对象实例传递给多个类的最佳方法是什么? - What's best way to pass different insances of object to multiple classes?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM