updates
This commit is contained in:
parent
7a83574022
commit
585064f300
|
@ -276,6 +276,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
|
||||||
self.hyp = hyp
|
self.hyp = hyp
|
||||||
self.image_weights = image_weights
|
self.image_weights = image_weights
|
||||||
self.rect = False if image_weights else rect
|
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
|
# Define labels
|
||||||
self.label_files = [x.replace('images', 'labels').replace(os.path.splitext(x)[-1], '.txt')
|
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]
|
label_path = self.label_files[index]
|
||||||
|
|
||||||
hyp = self.hyp
|
hyp = self.hyp
|
||||||
mosaic = True and self.augment # load 4 images at a time into a mosaic (only during training)
|
if self.mosaic:
|
||||||
if mosaic:
|
|
||||||
# Load mosaic
|
# Load mosaic
|
||||||
img, labels = load_mosaic(self, index)
|
img, labels = load_mosaic(self, index)
|
||||||
shapes = None
|
shapes = None
|
||||||
|
@ -450,7 +450,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
|
||||||
|
|
||||||
if self.augment:
|
if self.augment:
|
||||||
# Augment imagespace
|
# Augment imagespace
|
||||||
if not mosaic:
|
if not self.mosaic:
|
||||||
img, labels = random_affine(img, labels,
|
img, labels = random_affine(img, labels,
|
||||||
degrees=hyp['degrees'],
|
degrees=hyp['degrees'],
|
||||||
translate=hyp['translate'],
|
translate=hyp['translate'],
|
||||||
|
|
Loading…
Reference in New Issue