Created
June 29, 2021 01:47
-
-
Save RishiRajak/55c5c046e75034b298ff51ec086bc537 to your computer and use it in GitHub Desktop.
visualise number of images from dataframe
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
def get_n_images(n,df,label): | |
import warnings | |
warnings.filterwarnings('ignore') | |
train = df[df["image_labels"]==label] | |
print(len(train)) | |
i = 0 | |
m = n/2 | |
plt.figure(figsize=(12, 6)) | |
for path in train['image_abs_path'][0:n]: | |
plt.subplot(2,m,i+1) | |
get_image(path) | |
i += 1 | |
plt.tight_layout() | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment