Learn R Programming

kerasR (version 0.8.1)

img_to_array: Converts a PIL Image instance to a Numpy array.

Description

Converts a PIL Image instance to a Numpy array.

Usage

img_to_array(img, data_format = NULL)

Value

A 3D numeric array.

Arguments

img

PIL image file; usually loaded with load_img

data_format

either "channels_first" or "channels_last".

Author

Taylor B. Arnold, taylor.arnold@acm.org

References

Chollet, Francois. 2015. Keras: Deep Learning library for Theano and TensorFlow.

See Also

Other image: load_img

Other preprocessing: Tokenizer, expand_dims, load_img, one_hot, pad_sequences, text_to_word_sequence