zoo
decode_predictions¶
larq_zoo.decode_predictions(preds, top=5, **kwargs)
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).
preprocess_input¶
larq_zoo.preprocess_input(image)
Preprocesses a Tensor or Numpy array encoding a image.
Arguments
- image: Numpy array or symbolic Tensor, 3D.
Returns
Preprocessed Tensor or Numpy array.