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

View source: R/preprocessing.R

img_to_arrayR Documentation

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)

Arguments

img

PIL image file; usually loaded with load_img

data_format

either "channels_first" or "channels_last".

Value

A 3D numeric array.

Author(s)

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


kerasR documentation built on Aug. 17, 2022, 5:06 p.m.