Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danyashorokh/b555f2bf5f2739295071ea505bd11a5f to your computer and use it in GitHub Desktop.
Save danyashorokh/b555f2bf5f2739295071ea505bd11a5f to your computer and use it in GitHub Desktop.
[Python] Plot multiple images with titles
import matplotlib.pyplot as plt
def visualize(**images):
'Plot images'
n = len(images)
plt.figure(figsize=(16, 5))
for i, (name, image) in enumerate(images.items()):
plt.subplot(1, n, i + 1)
plt.xticks([])
plt.yticks([])
plt.title(" ".join(name.split("_")).title())
plt.imshow(image)
plt.show()
visualize(input_image=image, pred_mask=pred_mask, true_mask=mask)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment