ConvNeXt preprocessing utilities

[source]

decode_predictions function

keras.applications.convnext.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.convnext.preprocess_input(x, data_format=None)

A placeholder method for backward compatibility.

The preprocessing logic has been included in the convnext 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. Defaults to None, in which case the global setting keras.backend.image_data_format() is used (unless you changed it, it defaults to "channels_last").{mode}

Returns

Unchanged numpy.array or tensor.