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

[Feature Request] More Image Transforms (Brightness, Contrast, Hue) #271

Closed
Kaixhin opened this issue Sep 25, 2017 · 12 comments
Closed

[Feature Request] More Image Transforms (Brightness, Contrast, Hue) #271

Kaixhin opened this issue Sep 25, 2017 · 12 comments

Comments

@Kaixhin
Copy link
Contributor

Kaixhin commented Sep 25, 2017

It would be good to have some more image transforms (manual and random for augmentation). TensorFlow has the following:

  • Brightness
  • Contrast
  • Hue
  • Gamma
  • Saturation
@alykhantejani
Copy link
Contributor

a PR with some/most of these is already under review - we should look at getting that merged after #240 is merged.

@Kaixhin
Copy link
Contributor Author

Kaixhin commented Sep 25, 2017

Didn't spot because I was searching for hue, so thanks for bringing up! Yes makes sense to revisit after both of these are merged in.

@chsasank
Copy link
Contributor

@alykhantejani Shall I work on #27 and continue the PR?

@alykhantejani
Copy link
Contributor

@chsasank the ones in #27 probably need to be re-worked a bit. I'll comment on that PR and see if the authors are willing to make the change.

Do you want to start with Hue and Gamma (not present in #27) and then we can do the others (depending on the state of #27 then)?

@chsasank
Copy link
Contributor

chsasank commented Sep 27, 2017 via email

@Kaixhin
Copy link
Contributor Author

Kaixhin commented Sep 27, 2017

Automatic Portrait Segmentation for Image Stylization uses rotation, scale and gamma. Do Deep Convolutional Nets Really Need to be Deep and Convolutional? uses hue, saturation and value. I'm sure there are other papers out there, but I managed to find these two fairly quickly.

@alykhantejani
Copy link
Contributor

@chsasank
Copy link
Contributor

chsasank commented Sep 27, 2017

Thanks @Kaixhin, @alykhantejani ! TF implementation is really useful. I'll use function names and their parameters from there.

@fmassa
Copy link
Member

fmassa commented Sep 27, 2017

@Kaixhin note that for Automatic Portrait Segmentation for Image Stylization, performing simple rotations actually harms performance of the final model (even if you take care of rotating and cropping the image such that no boundary artifacts are introduced due to rotation).
Random scale and crop helps a lot though, but having a large number of transforms that in the end do not contribute to the end performance (and even hurts performance) seems that might not be worth to it to me, as it can confuse users (who might thought that more transforms = better).

A few links showing that some transforms might not be helpful:

But we can extend the transforms if you think it's worth it.

@Kaixhin
Copy link
Contributor Author

Kaixhin commented Sep 27, 2017

@fmassa it's true that naively throwing a lot of augmentations at data may hurt performance, but there are some cases where this extended set can help in particular. I'm currently looking at something where lighting conditions vary a lot 😰 As an example of where these augmentations have been used in practice, here's the transformation code for Single Shot Multibox Detector in ChainerCV.

@chsasank
Copy link
Contributor

I raised PR with hue and saturation transforms at #275. Will add more if interested :)

@alykhantejani
Copy link
Contributor

Closing as these we're addressed in #275

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

No branches or pull requests

4 participants