Created
March 3, 2020 17:22
-
-
Save sauravmishra1710/aeba76e0e0bb41230edf64338dc0dda7 to your computer and use it in GitHub Desktop.
Display all images in a folder
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 glob | |
import matplotlib.pyplot as plt | |
import matplotlib.image as mpimg | |
%matplotlib inline | |
images = [] | |
for img_path in glob.glob('./Data/1/*.png'): | |
images.append(mpimg.imread(img_path)) | |
plt.figure(figsize=(20,10)) | |
columns = 5 | |
for i, image in enumerate(images): | |
plt.subplot(len(images) / columns + 1, columns, i + 1) | |
plt.imshow(image) | |
plt.xticks([]) | |
plt.yticks([]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment