diff --git a/comp.ipynb.REMOVED.git-id b/comp.ipynb.REMOVED.git-id index 00cc96d..b1ef6f5 100644 --- a/comp.ipynb.REMOVED.git-id +++ b/comp.ipynb.REMOVED.git-id @@ -1 +1 @@ -946598e599580eb39a7de79d3607416538bc0019 \ No newline at end of file +fb39f9a23b728fadb88ce579f78bb419ff0eaab6 \ No newline at end of file diff --git a/src/utils/paste.py b/src/utils/paste.py index 60ded70..2db7f01 100644 --- a/src/utils/paste.py +++ b/src/utils/paste.py @@ -3,7 +3,7 @@ import random as rd import albumentations as A import numpy as np -from PIL import Image +from PIL import Image, ImageEnhance class RandomPaste(A.DualTransform): @@ -112,6 +112,10 @@ class RandomPaste(A.DualTransform): # update paste_shape after scaling paste_shape = np.array(paste_img.size, dtype=np.uint) + # change brightness randomly + filter = ImageEnhance.Brightness(paste_img) + paste_img = filter.enhance(rd.uniform(0.5, 1.5)) + # generate some positions positions = [] NB = rd.randint(1, self.nb)