Skip to content

Instantly share code, notes, and snippets.

@Lexie88rus
Created August 8, 2019 16:32
Show Gist options
  • Select an option

  • Save Lexie88rus/a61841b1f912d674788b4b085e634733 to your computer and use it in GitHub Desktop.

Select an option

Save Lexie88rus/a61841b1f912d674788b4b085e634733 to your computer and use it in GitHub Desktop.
Visualize augmented image and segmentation mask with imgaug
# 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