Last active
May 4, 2022 20:02
-
-
Save danyashorokh/b555f2bf5f2739295071ea505bd11a5f to your computer and use it in GitHub Desktop.
[Python] Plot multiple images with titles
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
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