Created
February 26, 2020 07:12
-
-
Save lakshay-arora/b8149570aaed51868bbd606369903599 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
# import skimage and matplotlib and random | |
from skimage import io | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
import random | |
# function to display image | |
def show(idx, title): | |
plt.figure() | |
plt.imshow(test_images[idx].reshape(28,28)) | |
plt.axis('off') | |
plt.title('\n\n{}'.format(test_labels[idx]), fontdict={'size': 16}) | |
# generate a random index | |
r = random.randint(0,len(test_images)-1) | |
# | |
print("Random Number Generated: ", r, "Image Label : ", test_labels[r]) | |
show(r, 'Image: {}'.format(test_images[rando])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment