Adam Kunák
commited on
🐛 [Fix] MixUp augmentation (#105) (#110)
Browse filesFixed an issue with the box targets (class_id, x_min, y_min, x_max, y_max) being multiplied by a random float value. fixes #105
yolo/tools/data_augmentation.py
CHANGED
@@ -174,10 +174,10 @@ class MixUp:
|
|
174 |
image1, image2 = TF.to_tensor(image), TF.to_tensor(image2)
|
175 |
mixed_image = lam * image1 + (1 - lam) * image2
|
176 |
|
177 |
-
#
|
178 |
-
|
179 |
|
180 |
-
return TF.to_pil_image(mixed_image),
|
181 |
|
182 |
|
183 |
class RandomCrop:
|
|
|
174 |
image1, image2 = TF.to_tensor(image), TF.to_tensor(image2)
|
175 |
mixed_image = lam * image1 + (1 - lam) * image2
|
176 |
|
177 |
+
# Merge bounding boxes
|
178 |
+
merged_boxes = torch.cat((boxes, boxes2))
|
179 |
|
180 |
+
return TF.to_pil_image(mixed_image), merged_boxes
|
181 |
|
182 |
|
183 |
class RandomCrop:
|