airctic / icevision

An Agnostic Computer Vision Framework - Pluggable to any Training Library: Fastai, Pytorch-Lightning with more to come
https://airctic.github.io/icevision/
Apache License 2.0
849 stars 150 forks source link

Add Mosaic Data Augmentation #587

Open ai-fast-track opened 3 years ago

ai-fast-track commented 3 years ago

🚀 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)

FraPochetti commented 2 years ago

Not enough bandwidth to implement.

potipot commented 2 years ago

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

FraPochetti commented 2 years ago

That'd be so awesome to have!