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 |
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.
|
preds |
A batch of outputs from the model. |
top |
The number of top predictions to return. |
Value
A list of decoded predictions in case of
application_decode_predictions()
.A batch of preprocessed inputs in case of
application_preprocess_inputs()
.
Functions
-
application_preprocess_inputs()
: Pre-process inputs to be used in the model -
application_decode_predictions()
: Decode predictions from the model
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)