Skip to content

Instantly share code, notes, and snippets.

@dipanjanS
Created August 21, 2019 16:02
Show Gist options
  • Save dipanjanS/8c9b85d22cdc9c0c663bdde58a757d8f to your computer and use it in GitHub Desktop.
Save dipanjanS/8c9b85d22cdc9c0c663bdde58a757d8f to your computer and use it in GitHub Desktop.
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