decode_predictions function¶
larq_zoo.decode_predictions(preds, top=5, **kwargs)
Decodes the prediction of an ImageNet model.
Argument
Arguments¶
preds: Numpy tensor encoding a batch of predictions. top: Integer, how many top-guesses to return.
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.
Raise
Raises¶
ValueError: In case of invalid shape of the pred
array (must be 2D).
preprocess_input function¶
larq_zoo.preprocess_input(image)
Preprocesses a Tensor or Numpy array encoding a image.
Argument
Arguments¶
image: Numpy array or symbolic Tensor, 3D.
Return
Returns¶
Preprocessed Tensor or Numpy array.