tf.keras.applications.resnet50.preprocess_input
tf.keras.applications.vgg16.preprocess_input
tf.keras.applications.vgg19.preprocess_input
tf.keras.applications.resnet50.preprocess_input( x, data_format=None, mode='caffe' )
Defined in tensorflow/python/keras/_impl/keras/applications/imagenet_utils.py
.
Preprocesses a tensor or Numpy array encoding a batch of images.
x
: Input Numpy or symbolic tensor, 3D or 4D.data_format
: Data format of the image tensor/array.mode
: One of "caffe", "tf". - caffe: will convert the images from RGB to BGR, then will zero-center each color channel with respect to the ImageNet dataset, without scaling. - tf: will scale pixels between -1 and 1, sample-wise.Preprocessed tensor or Numpy array.
ValueError
: In case of unknown data_format
argument.
© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/keras/applications/resnet50/preprocess_input