Skip to content

Instantly share code, notes, and snippets.

@VedPDubey
Created July 13, 2021 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VedPDubey/aa5fa7dfa049a0f3bbc16a8a587f1d86 to your computer and use it in GitHub Desktop.
Save VedPDubey/aa5fa7dfa049a0f3bbc16a8a587f1d86 to your computer and use it in GitHub Desktop.
labels = ["00-damage","01-whole"]
it = iter(testing_set)
batch = next(it) # Gets a batch of 16 test images
fig, axes = plt.subplots(3, 3, figsize=(10,10))
fig.tight_layout()
fig.subplots_adjust(hspace=.25)
for i in range(3):
for j in range(3):
ax = axes[i,j]
image = batch[0][i*3+j]
net_input = image.reshape((1, 64, 64, 3))
truth = np.argmax(batch[1][i*3+j])
prediction = np.argmax(model.predict(net_input))
ax.set_title('Label: %s\nPrediction: %s' % (labels[truth].capitalize(), labels[prediction].capitalize()))
ax.imshow(image)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment