Created
December 12, 2018 04:56
-
-
Save ChunML/456cb0d65a5ed06799615611f0d0df21 to your computer and use it in GitHub Desktop.
This file contains 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
def visualize_dataset(imgs, labels): | |
fig, axes = plt.subplots(ncols=4, nrows=4) | |
fig.set_size_inches(10, 10) | |
for i, img in enumerate(imgs): | |
img += means | |
np.clip(img, 0, 255, img) | |
img = img[0].astype(np.uint8) | |
img = Image.fromarray(img) | |
axes[int(i / 4), i % 4].imshow(img) | |
axes[int(i / 4), i % 4].axis('off') | |
axes[int(i / 4), i % 4].text(0, -10, | |
int_to_breed[labels[i]], | |
color='red', | |
fontsize=11) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment