open-source-ideas / ideas

💡 Looking for inspiration for your next open source project? Or perhaps you've got a brilliant idea you can't wait to share with others? Open Source Ideas is a community built specifically for this! 👋
6.59k stars 221 forks source link

A library of predefined image augmentation presets #321

Open KOLANICH opened 2 years ago

KOLANICH commented 2 years ago

Project description

There are multiple libs for image augmentations for machine learning. But they all are hard to use. I mean currently a user has to set up the augmentations himself, this causes either a lot of wheels to be reinvented or not enough augs be used in projects.

We need a simpler library with the following interface:

from ourLib import augment, presets
from PIL import Image

srcImg = Image.open("./src.png")

for img in augment(srcImg, preset=presets.middle):
    doSomethingWithAugmentedImage(img)

The new library should rely on other libs and should select the augmentations and their parameters randomly (underlying libs doing actual augs have this functionality) from the sensible defaults (presets). The defaults must be sensible, I mean the augmented images should be augmented as much as possible to be considered a good aug for the use case and not so much to be slow.

Relevant Technology

Complexity and required time

Complexity

Required time (ETA)

Categories

chekoduadarsh commented 2 years ago

@KOLANICH

Hey,

Looks like s a good idea. Few years ago I tried something like this in my work, https://github.com/chekoduadarsh/Custom-Image-Augmentation-Keras

Currently it has less image augmentation presets and very basic. I think you want the same but advanced with many. !!

KOLANICH commented 2 years ago

It turns out there exist some presets: https://github.com/pytorch/vision/blob/main/torchvision/transforms/autoaugment.py

I guess it should be separated into a different library.

KOLANICH commented 2 years ago

I have not really tested it , but here is what I have implemented:

https://github.com/KOLANICH-libs/PreImgAugment.py

Currently it only tries to do something with the precomputed autoaugment presets from Keras. It is very likely it does the completely different thing.