Created
August 15, 2019 10:20
-
-
Save dipanjanS/f7fed0794dd0f465181a5fb8a74502a5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get label imagenet ID | |
imgnet_map['Egyptian_cat'] | |
from tf_explain.core.occlusion_sensitivity import OcclusionSensitivity | |
explainer = OcclusionSensitivity() | |
img_inp = tf.keras.preprocessing.image.load_img(IMAGE_PATH, target_size=(299, 299)) | |
img_inp = tf.keras.preprocessing.image.img_to_array(img_inp) | |
grid = explainer.explain(([img_inp], None), model, 285, 7) | |
fig, ax = plt.subplots(figsize=(8, 8)) | |
plt.imshow(grid) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment