icevision icon indicating copy to clipboard operation
icevision copied to clipboard

Add Mosaic Data Augmentation

Open ai-fast-track opened this issue 5 years ago • 3 comments

🚀 Feature

This feature is an enhancement that can be added to our data augmentation pipeline.

Mosaic Transform represents a new data augmentation method that mixes 4 training images: 4 different contexts are mixed in one single image. It has been successfully used in both YOLOv4 and YOLOv5.

Combining several images having different sizes is clever idea because the model will learn to predict with several images with different scaling. A kind of progressive resizing but done exclusively on the augmented images while the rest of the images are trained with their original sizes in case we only apply the data augmentation on a certain percentage of the total images.

image

Here is a link to the definition of the mosaic augmentation. In case we implement something similar, we should discard the transform they use at the end of the method namely random_perspective because additional transforms can added in the IceVision transforms pipeline.

def load_mosaic(self, index)

ai-fast-track avatar Dec 11 '20 19:12 ai-fast-track

Not enough bandwidth to implement.

FraPochetti avatar Dec 18 '21 17:12 FraPochetti

I'm currently working on this, reopening. My implementation will be manual as albumentations dont allow this at the moment: https://github.com/albumentations-team/albumentations/issues/677

potipot avatar Dec 20 '21 11:12 potipot

That'd be so awesome to have!

FraPochetti avatar Dec 20 '21 11:12 FraPochetti