henry000 commited on
Commit
a253e8c
Β·
2 Parent(s): 1c7883f 9c96a90

πŸ”€ [Merge] branch 'DATASET' into TEST

Browse files
Files changed (1) hide show
  1. yolo/tools/data_augmentation.py +3 -3
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
- # Mix bounding boxes
178
- mixed_boxes = torch.cat([lam * boxes, (1 - lam) * boxes2])
179
 
180
- return TF.to_pil_image(mixed_image), mixed_boxes
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: