Skip to content

Instantly share code, notes, and snippets.

@ternaus
Last active July 27, 2020 19:09
Show Gist options
  • Save ternaus/02f581143a9ebe4a89c1c690ab6736f9 to your computer and use it in GitHub Desktop.
Save ternaus/02f581143a9ebe4a89c1c690ab6736f9 to your computer and use it in GitHub Desktop.
Medium, multitask, scenario 2
import albumentations as A
transform = A.Compose([
A.HorizontalFlip(p=0.5),
A.GridDistortion(p=0.5),
A.RandomCrop(height=1024, width=1024, p=0.5),
], p=1)
transformed = transform(image=image, masks=[mask, mask2])
image_transformed = transformed['image']
mask_transformed = transformed['masks'][0]
mask2_transformed = transformed['masks'][1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment