From d03cc157b744e643071549acaeca057af8c6647f Mon Sep 17 00:00:00 2001 From: FanFeast Date: Sun, 5 Nov 2023 23:46:46 -0500 Subject: [PATCH] fix for VisibleDepritiationWarning due to numpy --- utils/augmentations.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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