From 88ba61505fa07b12b608f598ed9d2cf91ff872c2 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 8 Oct 2019 13:30:21 +0200 Subject: [PATCH] updates --- train.py | 1 + utils/datasets.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/train.py b/train.py index 5b714cd5..a6f26c84 100644 --- a/train.py +++ b/train.py @@ -32,6 +32,7 @@ hyp = {'giou': 1.582, # giou loss gain 'momentum': 0.97, # SGD momentum 'weight_decay': 0.0004569, # optimizer weight decay 'fl_gamma': 0.5, # focal loss gamma + 'hsv_h': 0.0, # image HSV-Hue augmentation (fraction) 'hsv_s': 0.5703, # image HSV-Saturation augmentation (fraction) 'hsv_v': 0.3174, # image HSV-Value augmentation (fraction) 'degrees': 1.113, # image rotation (+/- deg) diff --git a/utils/datasets.py b/utils/datasets.py index 4a5152dc..597b905d 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -404,7 +404,6 @@ class LoadImagesAndLabels(Dataset): # for training/testing img_path = self.img_files[index] label_path = self.label_files[index] - hyp = self.hyp mosaic = True # load 4 images at a time into a mosaic if mosaic: @@ -440,8 +439,10 @@ class LoadImagesAndLabels(Dataset): # for training/testing labels[:, 4] = ratio[1] * h * (x[:, 2] + x[:, 4] / 2) + padh if self.augment: + hyp = self.hyp + # Augment colorspace - augment_hsv(img, hgain=hyp['hsv_h'], sgain=hyp['hsv_s'], vgain=0.0) + augment_hsv(img, hgain=hyp['hsv_h'], sgain=hyp['hsv_s'], vgain=hyp['hsv_v']) # Augment imagespace g = 0.0 if mosaic else 1.0 # do not augment mosaics