How to make my own dataset for keras?

6,518 views
Skip to first unread message

Hiro Hamada

unread,
Jun 2, 2016, 7:03:03 PM6/2/16
to Keras-users
Hello everyone, how can I make my own dataset for use in Keras? (I have 48000 sign language images of 32x32 px )

Matias Valdenegro

unread,
Jun 2, 2016, 7:22:23 PM6/2/16
to keras...@googlegroups.com
On Thursday, 2 June 2016 16:03:03 BST Hiro Hamada wrote:
> Hello everyone, how can I make my own dataset for use in Keras? (I have
> 48000 sign language images of 32x32 px )

Keras doesn't have any specific file formats, model.fit takes a (num_samples,
num_channels, width, height) numpy array for images in convolutional layers,
or just a (num_samples, num_features) array for non-convolutional layers.

So you just need to convert your data to a 4-dimensional numpy array, store it
(with pickle, numpy.save, HDF5), and load it back when you train.

The same applies for labels.

François Chollet

unread,
Jun 2, 2016, 7:46:06 PM6/2/16
to Matias Valdenegro, Keras-users
Keras takes data as Numpy arrays. Specifically, an image array should have shape (samples, channels, width, height).

So you just need to convert your images to Numpy arrays, for which you can use OpenCV, PIL, or SciPy. I recommend SciPy: http://www.scipy-lectures.org/advanced/image_processing/



--
You received this message because you are subscribed to the Google Groups "Keras-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keras-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/keras-users/12416202.UsCK6rUEzx%40vsd-grey-wolf.
For more options, visit https://groups.google.com/d/optout.

Poornachandra Sandur

unread,
Dec 27, 2017, 10:03:45 AM12/27/17
to Keras-users
If I have a set of images for Car and bicycles (say 20 car images and 20 bicycle images) . How to create the dataset for these images (similar to MNIST or CIFAR) using Numpy.

blackhol...@gmail.com

unread,
Jan 1, 2018, 10:05:35 PM1/1/18
to Keras-users
Check out this video on image preparation for CNN training with Keras: https://youtu.be/LhEMXbjGV_4

monkhorgil...@gmail.com

unread,
May 14, 2018, 11:05:33 PM5/14/18
to Keras-users


пятница, 3 июня 2016 г., 8:03:03 UTC+9 пользователь Hiro Hamada написал:
Reply all
Reply to author
Forward
0 new messages