Skip to content

Instantly share code, notes, and snippets.

@HSShashank
Created August 25, 2021 05:23
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 HSShashank/ea8afeba58da41abd34f715af07d31c8 to your computer and use it in GitHub Desktop.
Save HSShashank/ea8afeba58da41abd34f715af07d31c8 to your computer and use it in GitHub Desktop.
dim = len(classes)
fig,axes = plt.subplots(1,dim)
fig.subplots_adjust(0,0,2,2)
for idx, i in enumerate(classes):
dum = df[df['LABEL'] == i]
random_num = random.choice(dum.index)
label = df.loc[random_num]['LABEL']
axes[idx].imshow(cv2.imread(df.loc[random_num]['IMAGE PATH']))
axes[idx].set_title("CLASS: "+label +"\n" + "LABEL:"+str(map_classes[label]))
axes[idx].axis('off')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment