albumentations icon indicating copy to clipboard operation
albumentations copied to clipboard

Fill Color: Random ?

Open MentalGear opened this issue 5 years ago • 5 comments

Question / Improvement

In the api, some parameters have a fill_value. Is there an option for a random color fill ?

MentalGear avatar Nov 27 '19 18:11 MentalGear

Hi all, I would like to take up this enhancement. I propose to set fill_value parameter 'random' string for example in order to generate it randomly. It's gonna to affect following transforms:

  • PadIfNeeded
  • ShiftScaleRotate
  • OpticalDistortion
  • GridDistortion
  • ElasticTransform
  • Cutout
  • CoarseDropout
  • ChannelDropout
  • MaskDropout
  • GridDropout Probably I missed something..

@albu, @ternaus, @kirillbobyrev, @BloodAxe, @tatigabru, What do you think?

akarsakov avatar Apr 10 '20 11:04 akarsakov

I've decided to add this ability only for CoarseDropout, MaskDropout, and GridDropout. Looks like it doesn't make a lot of sense for others. Created PR: #597

akarsakov avatar Apr 21 '20 21:04 akarsakov

Added random filling for CoarseDropout in https://github.com/albumentations-team/albumentations/pull/1677

For other transforms - could be added.

We added stricted checks for types, hence it is a bit trickier to add random color than in https://github.com/albumentations-team/albumentations/pull/597

Also we want to support different image types, hence random sampling should be extended to other types beyond float32 and unit8. Still kind of similar to the PR fro @akarsakov

ternaus avatar Apr 20 '24 02:04 ternaus