Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- from PIL import Image
- fig, ax = plt.subplots(nrows=3, ncols=4)
- fig.tight_layout()
- cnt = 0
- for row in ax:
- for col in row:
- image_name = np.random.choice(os.listdir("plant-seedlings-data/" + labels[cnt]))
- im = Image.open("plant-seedlings-data/{}/{}".format(labels[cnt],image_name))
- col.imshow(im)
- col.set_title(labels[cnt])
- col.axis('off')
- cnt += 1
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement