Skip to content

Instantly share code, notes, and snippets.

@RishiRajak
Created June 29, 2021 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RishiRajak/55c5c046e75034b298ff51ec086bc537 to your computer and use it in GitHub Desktop.
Save RishiRajak/55c5c046e75034b298ff51ec086bc537 to your computer and use it in GitHub Desktop.
visualise number of images from dataframe
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