-
-
Save amankharwal/e4c70ec23507a1aa2162d3de9d74d322 to your computer and use it in GitHub Desktop.
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
categories = np.sort(os.listdir(folder_dir)) | |
fig, ax = plt.subplots(6,6, figsize=(25, 40)) | |
for i in range(6): | |
for j in range(6): | |
k = int(np.random.random_sample() * len(X_test)) | |
if(categories[np.argmax(y_test[k])] == categories[np.argmax(model.predict(X_test)[k])]): | |
ax[i,j].set_title("TRUE: " + categories[np.argmax(y_test[k])], color='green') | |
ax[i,j].set_xlabel("PREDICTED: " + categories[np.argmax(model.predict(X_test)[k])], color='green') | |
ax[i,j].imshow(np.array(X_test)[k].reshape(SIZE, SIZE, 3), cmap='gray') | |
else: | |
ax[i,j].set_title("TRUE: " + categories[np.argmax(y_test[k])], color='red') | |
ax[i,j].set_xlabel("PREDICTED: " + categories[np.argmax(model.predict(X_test)[k])], color='red') | |
ax[i,j].imshow(np.array(X_test)[k].reshape(SIZE, SIZE, 3), cmap='gray') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment