This commit is contained in:
Glenn Jocher 2019-10-08 13:30:21 +02:00
parent a18ad6025f
commit 88ba61505f
2 changed files with 4 additions and 2 deletions

View File

@ -32,6 +32,7 @@ hyp = {'giou': 1.582, # giou loss gain
'momentum': 0.97, # SGD momentum 'momentum': 0.97, # SGD momentum
'weight_decay': 0.0004569, # optimizer weight decay 'weight_decay': 0.0004569, # optimizer weight decay
'fl_gamma': 0.5, # focal loss gamma '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_s': 0.5703, # image HSV-Saturation augmentation (fraction)
'hsv_v': 0.3174, # image HSV-Value augmentation (fraction) 'hsv_v': 0.3174, # image HSV-Value augmentation (fraction)
'degrees': 1.113, # image rotation (+/- deg) 'degrees': 1.113, # image rotation (+/- deg)

View File

@ -404,7 +404,6 @@ class LoadImagesAndLabels(Dataset): # for training/testing
img_path = self.img_files[index] img_path = self.img_files[index]
label_path = self.label_files[index] label_path = self.label_files[index]
hyp = self.hyp
mosaic = True # load 4 images at a time into a mosaic mosaic = True # load 4 images at a time into a mosaic
if mosaic: if mosaic:
@ -440,8 +439,10 @@ class LoadImagesAndLabels(Dataset): # for training/testing
labels[:, 4] = ratio[1] * h * (x[:, 2] + x[:, 4] / 2) + padh labels[:, 4] = ratio[1] * h * (x[:, 2] + x[:, 4] / 2) + padh
if self.augment: if self.augment:
hyp = self.hyp
# Augment colorspace # 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 # Augment imagespace
g = 0.0 if mosaic else 1.0 # do not augment mosaics g = 0.0 if mosaic else 1.0 # do not augment mosaics