将图像存储在Python中的最有效方法?
我目前正在Python中的Image Server项目工作,但我无法找到有关将图像存储在内存中的最有效方法的信息。我已经尝试使用sys.getSizeof
尝试将对象的大小获取内存中的大小,但是它不会返回Numpy数组或PIL图像的准确大小。我还考虑过将所有python模块一起绕开,并将图像存储在tmpfs
ramdisk中,并在请求图像时将它们加载回。我感谢对这个问题的最佳实践的任何见解。
I'm currently working on a image server project in Python and I've been unable to find information on the most efficient way of storing the images in memory. I've tried using sys.getsizeof
to try to get the size of the object in memory, but it doesn't return an accurate size for numpy arrays or PIL images. I've also thought about bypassing Python modules all together and storing the images in a tmpfs
ramdisk and loading them back in when the images are requested. I'd appreciate any insights into the best practices for this problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论