Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding non-geometric augmentations #16

Open
Paethon opened this issue Mar 21, 2018 · 6 comments
Open

Adding non-geometric augmentations #16

Paethon opened this issue Mar 21, 2018 · 6 comments
Milestone

Comments

@Paethon
Copy link

Paethon commented Mar 21, 2018

Hi

I wanted to ask whether non-geometric augmentations would fit into Augmentor.jl

Especially things like brightness, contrast, white balance, etc.
https://github.com/aleju/imgaug has a quite wide array of image augmentations. All of them is probably a bit overkill, but a few would be useful I think.

If you think this would fit into the package I would start on adding a few additional augmentations.

@Evizero
Copy link
Owner

Evizero commented Mar 21, 2018

Actually, I really want to add these kinds of augmentation strategies. I just didn't get around to doing them yet.

If that is something you'd be interested in contributing I'd be very happy to provide guidance along the way. Probably a first good step is to make a list of possible additions and think about their properties. Surely some are less effort to add than others, especially if some version of it is already available in the JuliaImages ecosystem.

@Paethon
Copy link
Author

Paethon commented Mar 21, 2018

Thanks! I will have a look into what to add and how it might fit into the package and will come back to you.

@johnnychen94 johnnychen94 added this to the v0.7 milestone Dec 19, 2019
@barucden
Copy link
Collaborator

barucden commented Jul 9, 2021

Hi, I would like to revive this issue. I am missing blurring and brightness/contrast adjustments. I believe that these two are good to start with:

  1. Brightness & Contrast: parameters a, b so that out[i] = a * img[i] + b * mean(img)
  2. Gaussian blur: kernel size k and standard deviation s

It should be possible to define ranges from which the parameters are picked randomly, too.

My proposal is based on Albumentations as that is the library that I have worked with.

I guess that (1) can be implemented easily, and for (2) we could use ImageFiltering.jl.

Is this acceptable? If so, I can try to come up with an implementation.

@johnnychen94
Copy link
Collaborator

Using ImageFiltering sounds okay to me since it's already in the Project.toml dependency.

@barucden
Copy link
Collaborator

barucden commented Jul 9, 2021

Okay, great!

I have some questions regarding the implementation. Let's consider the brightness & contrast adjustment for now.

  1. I guess eager application is straightforward, but I could imagine a lazy one too (create a custom implementation of AbstractArray and define getindex so that it returns the adjusted pixel). Do I implement both approaches, or do I pick just one (eager is simpler here)?
  2. Which internal methods need to be defined for Augmentor to work? Is it only randparam and the appropriate support_* and apply*?

@johnnychen94
Copy link
Collaborator

johnnychen94 commented Jul 10, 2021

Do I implement both approaches, or do I pick just one (eager is simpler here)?

It's up to you. If you choose to only implement eager version then please leave a comment and an issue for the lazy version.

create a custom implementation of AbstractArray and define getindex so that it returns the adjusted pixel

FWIW, MappedArrays provides a lazy evaluation purpose, but it's not always type stable.

Which internal methods need to be defined for Augmentor to work?

You can take a look at #64 for an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants