Update MixUp augmentation `alpha=beta=32.0` (#3455)
Browse filesPer VOC empirical results https://github.com/ultralytics/yolov5/issues/3380#issuecomment-853001307 by
@developer0hye
- utils/datasets.py +1 -1
utils/datasets.py
CHANGED
@@ -535,7 +535,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
|
|
535 |
# MixUp https://arxiv.org/pdf/1710.09412.pdf
|
536 |
if random.random() < hyp['mixup']:
|
537 |
img2, labels2 = load_mosaic(self, random.randint(0, self.n - 1))
|
538 |
-
r = np.random.beta(
|
539 |
img = (img * r + img2 * (1 - r)).astype(np.uint8)
|
540 |
labels = np.concatenate((labels, labels2), 0)
|
541 |
|
|
|
535 |
# MixUp https://arxiv.org/pdf/1710.09412.pdf
|
536 |
if random.random() < hyp['mixup']:
|
537 |
img2, labels2 = load_mosaic(self, random.randint(0, self.n - 1))
|
538 |
+
r = np.random.beta(32.0, 32.0) # mixup ratio, alpha=beta=32.0
|
539 |
img = (img * r + img2 * (1 - r)).astype(np.uint8)
|
540 |
labels = np.concatenate((labels, labels2), 0)
|
541 |
|