Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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
You can’t perform that action at this time.