Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. num_of_samples = []
  2.  
  3. cols = 5
  4. num_classes = 43
  5.  
  6. fig, axs = plt.subplots(nrows=num_classes, ncols = cols, figsize=(5, 50))
  7. fig.tight_layout()
  8. for i in range(cols):
  9. for j,row in data.iterrows():
  10. x_selected = X_train[y_train == j]
  11. axs[j][i].imshow(x_selected[random.randint(0, len(x_selected - 1)), :, :], cmap=plt.get_cmap("gray"))
  12. axs[j][i].axis("off")
  13. if i == 2:
  14. axs[j][i].set_title(str(j) + "-" + row["SignName"])
  15. num_of_samples.append(len(x_selected))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement