Skip to content

Instantly share code, notes, and snippets.

@sararob
Last active November 18, 2020 22:01
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sararob/fa499725a1bae6aeb58f8250a4da7595 to your computer and use it in GitHub Desktop.
Save sararob/fa499725a1bae6aeb58f8250a4da7595 to your computer and use it in GitHub Desktop.
Explanation metadata for image models
# Change to the image size your model is expecting
# This example takes 192x192 images
random_baseline = np.random.rand(192,192,3)
explanation_metadata = {
"inputs": {
"data": {
"input_tensor_name": "input_pixels:0",
"modality": "image",
"input_baselines": [random_baseline.tolist()]
}
},
"outputs": {
"probability": {
"output_tensor_name": "dense/Softmax:0"
}
},
"framework": "tensorflow"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment