Added doc corresponding to decode_prediction() and preprocess_input()
diff --git a/tensorflow/python/keras/applications/mobilenet_v2.py b/tensorflow/python/keras/applications/mobilenet_v2.py
index a983f6d..f704f5a 100644
--- a/tensorflow/python/keras/applications/mobilenet_v2.py
+++ b/tensorflow/python/keras/applications/mobilenet_v2.py
@@ -491,11 +491,31 @@
@keras_export('keras.applications.mobilenet_v2.preprocess_input')
def preprocess_input(x, data_format=None):
- """Preprocesses the input (encoding a batch of images) for the model."""
+ """Preprocesses a numpy array encoding a batch of images.
+
+ Arguments
+ x: A 4D numpy array consists of RGB values within [0, 255].
+
+ Returns
+ Preprocessed array.
+ """
return imagenet_utils.preprocess_input(x, data_format=data_format, mode='tf')
@keras_export('keras.applications.mobilenet_v2.decode_predictions')
def decode_predictions(preds, top=5):
- """Decodes the prediction result from the model."""
+ """Decodes the prediction of an ImageNet model.
+
+ Arguments
+ preds: Numpy tensor encoding a batch of predictions.
+ top: Integer, how many top-guesses to return.
+
+ 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).
+ """
return imagenet_utils.decode_predictions(preds, top=top)