Keras: [Question] Loading images on disk for training

Created on 15 May 2015  路  4Comments  路  Source: keras-team/keras

Hello
Not sure how to build the X_train and Y_train objects from a set of images sitting on disk.
Are there any examples available?
Thanks

Most helpful comment

@davidlis did you ever find examples of how to do this?

All 4 comments

Images are just matrices. You can use scipy or opencv, its pretty straightforward: http://scipy-lectures.github.io/advanced/image_processing/

Keras has some utils that could use to do that: https://github.com/fchollet/keras/blob/master/keras/preprocessing/image.py

Take a look at load_img.

@davidlis did you ever find examples of how to do this?

Try the Class ImageDataGenerator from Keras. Look for the function called _flow_from_directory._
https://keras.io/preprocessing/image/#imagedatagenerator-class

Was this page helpful?
0 / 5 - 0 ratings