Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

imagenet_preprocess_input

Preprocesses a tensor or array encoding a batch of images.


Description

Preprocesses a tensor or array encoding a batch of images.

Usage

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

Arguments

x

Input Numpy or symbolic tensor, 3D or 4D.

data_format

Data format of the image tensor/array.

mode

One of "caffe", "tf", or "torch"

  • 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.

  • torch: will scale pixels between 0 and 1 and then will normalize each channel with respect to the ImageNet dataset.

Value

Preprocessed tensor or array.


keras

R Interface to 'Keras'

v2.4.0
MIT + file LICENSE
Authors
Daniel Falbel [ctb, cph, cre], JJ Allaire [aut, cph], François Chollet [aut, cph], RStudio [ctb, cph, fnd], Google [ctb, cph, fnd], Yuan Tang [ctb, cph] (<https://orcid.org/0000-0001-5243-233X>), Wouter Van Der Bijl [ctb, cph], Martin Studer [ctb, cph], Sigrid Keydana [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.