diff --git a/Augmentor/Pipeline.py b/Augmentor/Pipeline.py index 48dd945..e1e8738 100644 --- a/Augmentor/Pipeline.py +++ b/Augmentor/Pipeline.py @@ -335,6 +335,9 @@ def sample(self, n, multi_threaded=True): if n == 0: augmentor_images = self.augmentor_images + elif n < 0: + n_duplicates = abs(n) + augmentor_images = n_duplicates*self.augmentor_images else: augmentor_images = [random.choice(self.augmentor_images) for _ in range(n)]