From 095ec7c167bef4d30c0112012ca390f79651fbda Mon Sep 17 00:00:00 2001 From: Scott Date: Sun, 17 Jun 2018 22:38:29 -0400 Subject: [PATCH] Add ability to duplicate augmentor_images Instead of just being able to use all of the original images (n=0), this allows cloning the original images (by using a negative number) before applying the transformations. --- Augmentor/Pipeline.py | 3 +++ 1 file changed, 3 insertions(+) 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)]