process_utils {keras3}R Documentation

Preprocessing and postprocessing utilities

Description

These functions are used to preprocess and postprocess inputs and outputs of Keras applications.

Usage

application_preprocess_inputs(model, x, ..., data_format = NULL)

application_decode_predictions(model, preds, top = 5L, ...)

Arguments

model

A Keras model initialized using any application_ function.

x

A batch of inputs to the model.

...

Additional arguments passed to the preprocessing or decoding function.

data_format

Optional data format of the image tensor/array. NULL means the global setting config_image_data_format() is used (unless you changed it, it uses "channels_last"). Defaults to NULL.

preds

A batch of outputs from the model.

top

The number of top predictions to return.

Value

Functions

Examples

## Not run: 
model <- application_convnext_tiny()

inputs <- random_normal(c(32, 224, 224, 3))
processed_inputs <- application_preprocess_inputs(model, inputs)

preds <- random_normal(c(32, 1000))
decoded_preds <- application_decode_predictions(model, preds)


## End(Not run)

[Package keras3 version 1.1.0 Index]