This commit is contained in:
Glenn Jocher
2019-06-12 14:35:10 +02:00
parent 81b4a7833f
commit c5cb3c8a9e
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -230,7 +230,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
augment_hsv = True
if self.augment and augment_hsv:
# SV augmentation by 50%
fraction = 0.25 # must be < 1.0
fraction = 0.50 # must be < 1.0
img_hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) # hue, sat, val
S = img_hsv[:, :, 1].astype(np.float32) # saturation
V = img_hsv[:, :, 2].astype(np.float32) # value
@@ -269,7 +269,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
# Augment image and labels
if self.augment:
img, labels = random_affine(img, labels, degrees=(-5, 5), translate=(0.0, 0.0), scale=(1.0, 1.0))
img, labels = random_affine(img, labels, degrees=(-5, 5), translate=(0.10, 0.10), scale=(0.90, 1.10))
nL = len(labels) # number of labels
if nL: