Skip to content

Clarification about albumentations implementation? #2118

Answered by AdeelH
NoaMillsUSDA-ARS asked this question in Q&A
Discussion options

You must be logged in to vote

The way data augmentation works (in both RV and in general) is that when sampling an image, each augmentation is applied with some probability. So if you train for multiple epochs, the same image will show up with a different combination of transforms applied each time. Training with such transformations is theoretically equivalent to augmenting the dataset with these transformed samples. The size of the dataset (in the len(ds) sense) does not change.

E.g. if the transform is:

tf = A.Compose([
  A.HorizontalFlip(p=0.5),
  A.VerticalFlip(p=0.5),
])

You can imagine the sampled image going through each transform in this pipeline one by one and each being applied with the specified probabilit…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@NoaMillsUSDA-ARS
Comment options

Answer selected by NoaMillsUSDA-ARS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants