Skip to content

RandAugment.get_standard_policy should propagate value range to RandomBrightness and RandomContrasts #427

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

Open
martin-gorner opened this issue May 11, 2022 · 7 comments

Comments

@martin-gorner
Copy link

martin-gorner commented May 11, 2022

When using RandomBrightness and RandomContrasts from RandAugment.get_standard_policy() with value_range=(0,1), two issues arise:

  • RandomContrast computes output values correctly but does not clip them to the (0,1) range
  • RandomBrightness computes incorrect output values that a massively out of range, and does not clip them either

This issue canot be fixed until TF 2.10

Please note that this issues does not affect RandAugment(value_range=(0,1)) which rescales internally to range (0,255) before applying all augmentations. RandAugment(value_range=(0,1)) works correctly.

Repro Colab: https://colab.research.google.com/drive/1dig1GRPRW_7MwKV-Z0z_2tAVqnFjJ6PH?usp=sharing

@martin-gorner martin-gorner added the type:Bug Something isn't working label May 11, 2022
@bhack
Copy link
Contributor

bhack commented May 11, 2022

This issue canot be fixed until TF 2.10

I think that for RandomBrightness the value_range arg is already available with TF 2.9rc2 right?

For RandomContrasts instead it is still not available also in master.

@LukeWood
Copy link
Contributor

This issue canot be fixed until TF 2.10

I think that for RandomBrightness the value_range arg is already available with TF 2.9rc2 right?

For RandomContrasts instead it is still not available also in master.

I think it came after the branch cut. Tested it today in a local runtime.

@bhack
Copy link
Contributor

bhack commented May 12, 2022

I think it came after the branch cut. Tested it today in a local runtime.

If you click you can see that I'am on the rc2 tag.

@LukeWood
Copy link
Contributor

I think it came after the branch cut. Tested it today in a local runtime.

If you click you can see that I'am on the rc2 tag.

Weird, I just have installed the wrong version. Good to know, with 2.9 we can fix 1/2 the issue. We will do so before KerasCV 0.2.0

@martin-gorner
Copy link
Author

Great! This will fix the problem with RandomBrightness which outputs the wrong values. The lack of clipping is slightly less important because it is smaller in magnitude.

@bhack
Copy link
Contributor

bhack commented May 12, 2022

#429

@sachinprasadhs
Copy link
Collaborator

Thanks for reporting the issue! We have consolidated the development of KerasCV into the new KerasHub package, which supports image, text, and multi-modal models. Please read the announcement. KerasHub will support all the core functionality of KerasCV.

KerasHub can be installed with !pip install -U keras-hub. Documentation and guides are available at keras.io/keras_hub.

With our focus shifted to KerasHub, we are not planning any further development or releases in KerasCV. If you encounter a KerasCV feature that is missing from KerasHub, or would like to propose an addition to the library, please file an issue with KerasHub.

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