Learn R Programming

keras (version 2.0.9)

imagenet_preprocess_input: Preprocesses a tensor encoding a batch of images.

Description

Preprocesses a tensor encoding a batch of images.

Usage

imagenet_preprocess_input(x, data_format = NULL, mode = "caffe")

Arguments

x

input tensor, 4D

data_format

Data format of the image tensor

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.

Value

Preprocessed tensor