Created
August 8, 2019 16:32
-
-
Save Lexie88rus/a61841b1f912d674788b4b085e634733 to your computer and use it in GitHub Desktop.
Visualize augmented image and segmentation mask with imgaug
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
| # Import matplotlib for visualization | |
| from matplotlib import pyplot as plt | |
| # Visualize original image, augmented image, and segmentation map | |
| side_by_side = np.hstack([ | |
| segmap.draw_on_image(image), # show blend of original image and segmentation map | |
| segmap_aug.draw_on_image(image_aug), # show blend of augmented image and segmentation map | |
| segmap_aug.draw() # show only the augmented segmentation map | |
| ]) | |
| fig, ax = plt.subplots(figsize=(10, 7)) | |
| ax.axis('off') | |
| plt.title('Augmentations for segmentation masks') | |
| ax.imshow(side_by_side) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment