Skip to content

Instantly share code, notes, and snippets.

@sararob

sararob/generate_metadata.py Secret

Last active Nov 18, 2020
Embed
What would you like to do?
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