Skip to content

Commit

Permalink
Merge pull request #404 from aashish-kumar/patch-2
Browse files Browse the repository at this point in the history
Visualization fix handling multi-channel images
  • Loading branch information
npapernot authored May 29, 2018
2 parents 0e481f2 + a6268d7 commit 81fa7bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cleverhans/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ def pair_visual(original, adversarial, figure=None):
"""
import matplotlib.pyplot as plt

# Squeeze the image to remove single-dimensional entries from array shape
original = np.squeeze(original)
adversarial = np.squeeze(adversarial)

# Ensure our inputs are of proper shape
assert(len(original.shape) == 2 or len(original.shape) == 3)

Expand Down

0 comments on commit 81fa7bb

Please sign in to comment.