Skip to content

Commit 1c6c875

Browse files
authored
Update captumyt.py
Revert use of viz since it is used in rest of file
1 parent 563bf24 commit 1c6c875

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

beginner_source/introyt/captumyt.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,8 @@
247247
attributions_ig = integrated_gradients.attribute(input_img, target=pred_label_idx, n_steps=200)
248248

249249
# Show the original image for comparison
250-
original_image_np = np.transpose(transformed_img.squeeze().cpu().detach().numpy(), (1,2,0))
251-
fig, ax = plt.subplots(figsize=(6, 6))
252-
ax.imshow(original_image_np)
253-
ax.set_title("Original Image")
254-
ax.axis('off')
255-
plt.show()
250+
_ = viz.visualize_image_attr(None, np.transpose(transformed_img.squeeze().cpu().detach().numpy(), (1,2,0)),
251+
method="original_image", title="Original Image")
256252

257253
default_cmap = LinearSegmentedColormap.from_list('custom blue',
258254
[(0, '#ffffff'),

0 commit comments

Comments
 (0)