Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. from PIL import Image
  4.  
  5. fig, ax = plt.subplots(nrows=3, ncols=4)
  6. fig.tight_layout()
  7. cnt = 0
  8. for row in ax:
  9. for col in row:
  10. image_name = np.random.choice(os.listdir("plant-seedlings-data/" + labels[cnt]))
  11. im = Image.open("plant-seedlings-data/{}/{}".format(labels[cnt],image_name))
  12. col.imshow(im)
  13. col.set_title(labels[cnt])
  14. col.axis('off')
  15. cnt += 1
  16. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement