diff --git a/utils/augmentations.py b/utils/augmentations.py index cc7a73aa3..f8b94c659 100644 --- a/utils/augmentations.py +++ b/utils/augmentations.py @@ -306,7 +306,8 @@ def __call__(self, image, masks, boxes=None, labels=None): height, width, _ = image.shape while True: # randomly choose a mode - mode = random.choice(self.sample_options) + mode = self.sample_options[random.randint(0, len(self.sample_options) - 1)] + if mode is None: return image, masks, boxes, labels