Skip to content

Instantly share code, notes, and snippets.

@Lexie88rus
Created August 8, 2019 18:51
Show Gist options
  • Save Lexie88rus/eed4021f1b1194b7753d434d5e0d5696 to your computer and use it in GitHub Desktop.
Save Lexie88rus/eed4021f1b1194b7753d434d5e0d5696 to your computer and use it in GitHub Desktop.
Augmenter simple example
# Import package
import Augmentor
# Initialize pipeline
p = Augmentor.DataPipeline([[np.array(image), np.array(mask)]])
# Apply augmentations
p.rotate(1, max_left_rotation=3, max_right_rotation=3)
p.shear(1, max_shear_left = 3, max_shear_right = 3)
p.zoom_random(1, percentage_area=0.9)
# Sample from augmentation pipeline
images_aug = p.sample(1)
# Access augmented image and mask
augmented_image = images_aug[0][0]
augmented_mask = images_aug[0][1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment