Augmentor icon indicating copy to clipboard operation
Augmentor copied to clipboard

Augment Color of images but not in masks of ground truth for Image segmentation

Open akansal1 opened this issue 6 years ago • 6 comments

I am working on a image segmentation problem where I would like to augment images with a condition, that all color augmentation methods does not affect ground truth data

Is there a way where I can keep ground truth constant for the selected augmentation operations

thanks

akansal1 avatar May 17 '18 10:05 akansal1

I have the same problem. Using random_contrast destroys the categorical ground truth image

ChristianEschen avatar Oct 24 '18 08:10 ChristianEschen

I trying to use augmentation for semantic segmentation, so I need that ground truth doesn't change with random_brightness or random_color. Any update on this?

leiverandres avatar Dec 14 '18 23:12 leiverandres

Similar issues here: I am working on a segmentation problem so the ground truth images are masks containing specific RGB values which represent the different classes. Functions like rotate, skew and shear all change the pixel values of the ground truth images.

These two options would be great to have in the future:

  • An options for using Nearest Neighbor algorithm during operations on ground truth images.
  • An input pixel value for functions which remove part of the image as most of the segmentation problems include a void/background class.

If this would be implemented that would be amazing. Besides this, I love your Augmentor. Really great and easy to use! Loving it.

I might work on some of these implementations myself. Will let you know!

MarcSchotman avatar Jan 24 '19 11:01 MarcSchotman

Hi all, right now job responsibilities are keeping me from actually doing anything on Augmentor I'm afraid :-) Apologies also for not replying to this issue for so long. However, next week I have time and I will be making a few updates, and I will try to get as many issues fixed as I can for the next release.

Anyway, the thing is, I am not sure exactly what you mean by this issue... @SchotmanG how do you mean the pixel values of the ground truth images change?

Oh and if you want to make any changes of course you can make a PR and I can merge it in.

mdbloice avatar Jan 25 '19 13:01 mdbloice

I didn't go into actually changing your code in the end. Was going to be too time consuming for me w.r.t. the reward. But i'll explain my (and probably many other peoples) problem with the ground truth images.

While using the augmentor for semantic image segmentation EACH pixel has a label, this label is often a certain rgb value. So here an example:

Input image: 0033

Label i.e. ground truth picture: 0033

This ground truth image contains only 4 different RGB values representing the 4 classes. So what happens to these ground truth images is very important all rotations/shears/resizings shoudl not introduce any new RGB values. I think pretty much every rotation/warp/zoom function has an interpolation option which can be set to Nearest Neighbor. This would pretty much solve this issue.

MarcSchotman avatar Jan 25 '19 16:01 MarcSchotman

I didn't go into actually changing your code in the end. Was going to be too time consuming for me w.r.t. the reward. But i'll explain my (and probably many other peoples) problem with the ground truth images.

While using the augmentor for semantic image segmentation EACH pixel has a label, this label is often a certain rgb value. So here an example:

Input image: 0033

Label i.e. ground truth picture: 0033

This ground truth image contains only 4 different RGB values representing the 4 classes. So what happens to these ground truth images is very important all rotations/shears/resizings shoudl not introduce any new RGB values. I think pretty much every rotation/warp/zoom function has an interpolation option which can be set to Nearest Neighbor. This would pretty much solve this issue.

I am having the same problem exactly. Does anyone know how to fix it?

YounesHB92 avatar Aug 03 '21 04:08 YounesHB92