Keras 3 API documentation / Keras Applications / EfficientNet B0 to B7 / EfficientNet preprocessing utilities

EfficientNet preprocessing utilities

[source]

decode_predictions function

keras.applications.efficientnet.decode_predictions(preds, top=5)

Decodes the prediction of an ImageNet model.

Arguments

  • preds: NumPy array encoding a batch of predictions.
  • top: Integer, how many top-guesses to return. Defaults to 5.

Returns

A list of lists of top class prediction tuples (class_name, class_description, score). One list of tuples per sample in batch input.

Raises

  • ValueError: In case of invalid shape of the pred array (must be 2D).

[source]

preprocess_input function

keras.applications.efficientnet.preprocess_input(x, data_format=None)

A placeholder method for backward compatibility.

The preprocessing logic has been included in the efficientnet model implementation. Users are no longer required to call this method to normalize the input data. This method does nothing and only kept as a placeholder to align the API surface between old and new version of model.

Arguments

  • x: A floating point numpy.array or a tensor.
  • data_format: Optional data format of the image tensor/array. None means the global setting keras.backend.image_data_format() is used (unless you changed it, it uses "channels_last"). Defaults to None.

Returns

Unchanged numpy.array or tensor.