This commit is contained in:
Glenn Jocher 2020-03-10 13:33:14 -07:00
parent 7a83574022
commit 585064f300
1 changed files with 3 additions and 3 deletions

View File

@ -276,6 +276,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
self.hyp = hyp
self.image_weights = image_weights
self.rect = False if image_weights else rect
self.mosaic = self.augment and not self.rect # load 4 images at a time into a mosaic (only during training)
# Define labels
self.label_files = [x.replace('images', 'labels').replace(os.path.splitext(x)[-1], '.txt')
@ -417,8 +418,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
label_path = self.label_files[index]
hyp = self.hyp
mosaic = True and self.augment # load 4 images at a time into a mosaic (only during training)
if mosaic:
if self.mosaic:
# Load mosaic
img, labels = load_mosaic(self, index)
shapes = None
@ -450,7 +450,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
if self.augment:
# Augment imagespace
if not mosaic:
if not self.mosaic:
img, labels = random_affine(img, labels,
degrees=hyp['degrees'],
translate=hyp['translate'],