diff --git a/augraphy/base/oneof.py b/augraphy/base/oneof.py index 40fb020..74949af 100644 --- a/augraphy/base/oneof.py +++ b/augraphy/base/oneof.py @@ -18,7 +18,6 @@ class OneOf(Augmentation): def __init__(self, augmentations, p=1): """Constructor method""" self.augmentations = augmentations - self.augmentation_probabilities = self.compute_probability(self.augmentations) self.p = p # Randomly selects an Augmentation to apply to data. @@ -26,6 +25,7 @@ def __call__(self, image, layer=None, mask=None, keypoints=None, bounding_boxes= if force or self.should_run(): # Select one augmentation using the max value in probability values + self.augmentation_probabilities = self.compute_probability(self.augmentations) augmentation = self.augmentations[np.argmax(self.augmentation_probabilities)] # Applies the selected Augmentation.