Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- num_of_samples = []
- cols = 5
- num_classes = 43
- fig, axs = plt.subplots(nrows=num_classes, ncols = cols, figsize=(5, 50))
- fig.tight_layout()
- for i in range(cols):
- for j,row in data.iterrows():
- x_selected = X_train[y_train == j]
- axs[j][i].imshow(x_selected[random.randint(0, len(x_selected - 1)), :, :], cmap=plt.get_cmap("gray"))
- axs[j][i].axis("off")
- if i == 2:
- axs[j][i].set_title(str(j) + "-" + row["SignName"])
- num_of_samples.append(len(x_selected))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement