Skip to content

Instantly share code, notes, and snippets.

@frogermcs
Created May 27, 2019 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frogermcs/ab75f6d8f56c967d4ddb2057a4604693 to your computer and use it in GitHub Desktop.
Save frogermcs/ab75f6d8f56c967d4ddb2057a4604693 to your computer and use it in GitHub Desktop.
# Set batch of images into input tensor
tflite_interpreter.set_tensor(input_details[0]['index'], val_image_batch)
# Run inference
tflite_interpreter.invoke()
# Get prediction results
tflite_model_predictions = tflite_interpreter.get_tensor(output_details[0]['index'])
print("Prediction results shape:", tflite_model_predictions.shape)
# >> Prediction results shape: (32, 5)
# Convert prediction results to Pandas dataframe, for better visualization
tflite_pred_dataframe = pd.DataFrame(tflite_model_predictions)
tflite_pred_dataframe.columns = dataset_labels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment