简体   繁体   English

如何加载存储在zip文件中的一组图像?

[英]How to load a set of images stored in a zip file?

I'm a beginner in Machine Learning and want to play around with some image classification code from github with the data I have. 我是机器学习的初学者,想要使用github中的一些图像分类代码和我拥有的数据。 I am having problem loading the image data in python. 我在python中加载图像数据时遇到问题。 Problem being - I don't know how. 问题是 - 我不知道如何。 How would I load the data and format it? 我如何加载数据并格式化?

The word "read" is vague, but here is an example which reads a jpeg file using the Image class, and prints information about it. 单词“read”是模糊的,但这里是一个使用Image类读取jpeg文件并打印有关它的信息的示例。

import os,sys 
import Image 
jpgfile = Image.open("picture.jpg")

print jpgfile.bits, jpgfile.size, jpgfile.format

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM