Created
August 21, 2019 16:02
-
-
Save dipanjanS/8c9b85d22cdc9c0c663bdde58a757d8f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
fig, ax = plt.subplots(2, 4, figsize=(12, 6)) | |
for idx, img_idx in enumerate([15, 123, 230, 340, 450, 560, 670]): | |
id1 = 1 if idx > 3 else 0 | |
id2 = idx % 4 | |
predicted_label = class_label_mapping[ | |
np.argmax( | |
resnet_ft_model4.predict( | |
np.array([test_data_X[img_idx]]) | |
),axis=1 | |
)[0] | |
] | |
f = ax[id1, id2].imshow(test_data_X[img_idx], aspect='auto') | |
t = ax[id1, id2].set_title('Actual: {}\nPredicted: {}'.format(test_data_y[img_idx], | |
predicted_label), | |
fontsize=10) | |
ax[1,3].set_axis_off() | |
fig.tight_layout() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment