-
Notifications
You must be signed in to change notification settings - Fork 330
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
Creates the RandomAugmentationPipeline Layer #281
Conversation
Replace sample() -> __call__()
RandomPolicy is nice. RandomlySampledPolicy maybe? |
CC @mattdangerw because he may have some good naming advice |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update -- it looks very nice now!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
* Autocontrast label support * Update with_labels test * Update with_labels test * Fix no-op label augs * reformat * Add CutMix to with_labels_test * Begin migrating to Factor pattern * Update layers and tests to pass * reformat * Update serialization_test to pass * Update factor to pass lint * Rename `Factor` => `FactorSampler` * Update docstrings * Update factor -> factor_sampler Replace sample() -> __call__() * add self * Update docs to suggest keras_cv.FactorSampler over keras_cv.core * Update docstrings to not recommend keras_cv.core * Update to use stateless_random * Revert stateless random change * Update serialization_test to pass * Update factor to pass lint * Add preprocessing util * implement random color degeneration layer * format * license header + shell lint check for it * Docstring update * Add test based on luma value * much better color degeneration tests * run isort * Update layers.py * fix isort params * remove randaugment * begin randaugment * begin working on randaugment layer * holding commit * Update randaugment * Update rand_augment class * Udpate example * rebase randaugment * Implement `NormalFactor`. * Add some unit tests for RandAugment * Update docstring, update TODOs * Add label test * Run format * Fix lint issues * Support value range * Fix uint8/int32 test cases * Add test cases for value range * re-tune cutout policy * Add seed parameter * Factor sampler rename * Update to require value ranges, use new factor api * Update compare function * fix serialization_test * Fix broken rebase * Add shape and dtype arg * Revert spurious change * Revert spurious changes * Remove inaccurate docstring * Update sample() calls * Revert spurious preprocessing change * Revert spurious preprocessing change * Update rand_augment docstring * RandAugment failing due to sub-layers not handling labels * Rebased on top of add no-op branch * make randaugment subclass BaseImageAugmentationLayer * Reformat * Support kwargs * remove unused import * Add extra magnitude check * Reformat * tf.range bug? * Disable auto vectorize * Update RandAugment policies to support solarize sampling * Fix lint faulure * Update test case * Update rand augment demo and mildly tweak policy * Update RandAugment per feedback * update serialization test * Update stdev param name * Update seed * Update augmentated_sample -> augmented_sample * add rate to test coverage * add @tf.keras.utils.register_keras_serializable(package="keras_cv") * Add seed to constructor * Remove augmentation pipeline * Additional refactoring * add extra newline * Update to compile, update example * create demo of pipeline * Update to work with RandAugment * Update serialization test to include pipeline * Add custom layer to count invocations * Test pipeline test * format * Update unit test * What in the world is going on * Update to make test failures even more clear * Fix random_augmentation_pipeline * add seed back to random hue - weird * make unit tests pass * fix random augmentation pipeline demo * Update magnitude stddev * Wrote docstring * Fix typo * Update serialization, address scott comments * Francois comments * add clipping information * update docstring * Update docstring * Add f string
* Autocontrast label support * Update with_labels test * Update with_labels test * Fix no-op label augs * reformat * Add CutMix to with_labels_test * Begin migrating to Factor pattern * Update layers and tests to pass * reformat * Update serialization_test to pass * Update factor to pass lint * Rename `Factor` => `FactorSampler` * Update docstrings * Update factor -> factor_sampler Replace sample() -> __call__() * add self * Update docs to suggest keras_cv.FactorSampler over keras_cv.core * Update docstrings to not recommend keras_cv.core * Update to use stateless_random * Revert stateless random change * Update serialization_test to pass * Update factor to pass lint * Add preprocessing util * implement random color degeneration layer * format * license header + shell lint check for it * Docstring update * Add test based on luma value * much better color degeneration tests * run isort * Update layers.py * fix isort params * remove randaugment * begin randaugment * begin working on randaugment layer * holding commit * Update randaugment * Update rand_augment class * Udpate example * rebase randaugment * Implement `NormalFactor`. * Add some unit tests for RandAugment * Update docstring, update TODOs * Add label test * Run format * Fix lint issues * Support value range * Fix uint8/int32 test cases * Add test cases for value range * re-tune cutout policy * Add seed parameter * Factor sampler rename * Update to require value ranges, use new factor api * Update compare function * fix serialization_test * Fix broken rebase * Add shape and dtype arg * Revert spurious change * Revert spurious changes * Remove inaccurate docstring * Update sample() calls * Revert spurious preprocessing change * Revert spurious preprocessing change * Update rand_augment docstring * RandAugment failing due to sub-layers not handling labels * Rebased on top of add no-op branch * make randaugment subclass BaseImageAugmentationLayer * Reformat * Support kwargs * remove unused import * Add extra magnitude check * Reformat * tf.range bug? * Disable auto vectorize * Update RandAugment policies to support solarize sampling * Fix lint faulure * Update test case * Update rand augment demo and mildly tweak policy * Update RandAugment per feedback * update serialization test * Update stdev param name * Update seed * Update augmentated_sample -> augmented_sample * add rate to test coverage * add @tf.keras.utils.register_keras_serializable(package="keras_cv") * Add seed to constructor * Remove augmentation pipeline * Additional refactoring * add extra newline * Update to compile, update example * create demo of pipeline * Update to work with RandAugment * Update serialization test to include pipeline * Add custom layer to count invocations * Test pipeline test * format * Update unit test * What in the world is going on * Update to make test failures even more clear * Fix random_augmentation_pipeline * add seed back to random hue - weird * make unit tests pass * fix random augmentation pipeline demo * Update magnitude stddev * Wrote docstring * Fix typo * Update serialization, address scott comments * Francois comments * add clipping information * update docstring * Update docstring * Add f string
* Autocontrast label support * Update with_labels test * Update with_labels test * Fix no-op label augs * reformat * Add CutMix to with_labels_test * Begin migrating to Factor pattern * Update layers and tests to pass * reformat * Update serialization_test to pass * Update factor to pass lint * Rename `Factor` => `FactorSampler` * Update docstrings * Update factor -> factor_sampler Replace sample() -> __call__() * add self * Update docs to suggest keras_cv.FactorSampler over keras_cv.core * Update docstrings to not recommend keras_cv.core * Update to use stateless_random * Revert stateless random change * Update serialization_test to pass * Update factor to pass lint * Add preprocessing util * implement random color degeneration layer * format * license header + shell lint check for it * Docstring update * Add test based on luma value * much better color degeneration tests * run isort * Update layers.py * fix isort params * remove randaugment * begin randaugment * begin working on randaugment layer * holding commit * Update randaugment * Update rand_augment class * Udpate example * rebase randaugment * Implement `NormalFactor`. * Add some unit tests for RandAugment * Update docstring, update TODOs * Add label test * Run format * Fix lint issues * Support value range * Fix uint8/int32 test cases * Add test cases for value range * re-tune cutout policy * Add seed parameter * Factor sampler rename * Update to require value ranges, use new factor api * Update compare function * fix serialization_test * Fix broken rebase * Add shape and dtype arg * Revert spurious change * Revert spurious changes * Remove inaccurate docstring * Update sample() calls * Revert spurious preprocessing change * Revert spurious preprocessing change * Update rand_augment docstring * RandAugment failing due to sub-layers not handling labels * Rebased on top of add no-op branch * make randaugment subclass BaseImageAugmentationLayer * Reformat * Support kwargs * remove unused import * Add extra magnitude check * Reformat * tf.range bug? * Disable auto vectorize * Update RandAugment policies to support solarize sampling * Fix lint faulure * Update test case * Update rand augment demo and mildly tweak policy * Update RandAugment per feedback * update serialization test * Update stdev param name * Update seed * Update augmentated_sample -> augmented_sample * add rate to test coverage * add @tf.keras.utils.register_keras_serializable(package="keras_cv") * Add seed to constructor * Remove augmentation pipeline * Additional refactoring * add extra newline * Update to compile, update example * create demo of pipeline * Update to work with RandAugment * Update serialization test to include pipeline * Add custom layer to count invocations * Test pipeline test * format * Update unit test * What in the world is going on * Update to make test failures even more clear * Fix random_augmentation_pipeline * add seed back to random hue - weird * make unit tests pass * fix random augmentation pipeline demo * Update magnitude stddev * Wrote docstring * Fix typo * Update serialization, address scott comments * Francois comments * add clipping information * update docstring * Update docstring * Add f string
* Autocontrast label support * Update with_labels test * Update with_labels test * Fix no-op label augs * reformat * Add CutMix to with_labels_test * Begin migrating to Factor pattern * Update layers and tests to pass * reformat * Update serialization_test to pass * Update factor to pass lint * Rename `Factor` => `FactorSampler` * Update docstrings * Update factor -> factor_sampler Replace sample() -> __call__() * add self * Update docs to suggest keras_cv.FactorSampler over keras_cv.core * Update docstrings to not recommend keras_cv.core * Update to use stateless_random * Revert stateless random change * Update serialization_test to pass * Update factor to pass lint * Add preprocessing util * implement random color degeneration layer * format * license header + shell lint check for it * Docstring update * Add test based on luma value * much better color degeneration tests * run isort * Update layers.py * fix isort params * remove randaugment * begin randaugment * begin working on randaugment layer * holding commit * Update randaugment * Update rand_augment class * Udpate example * rebase randaugment * Implement `NormalFactor`. * Add some unit tests for RandAugment * Update docstring, update TODOs * Add label test * Run format * Fix lint issues * Support value range * Fix uint8/int32 test cases * Add test cases for value range * re-tune cutout policy * Add seed parameter * Factor sampler rename * Update to require value ranges, use new factor api * Update compare function * fix serialization_test * Fix broken rebase * Add shape and dtype arg * Revert spurious change * Revert spurious changes * Remove inaccurate docstring * Update sample() calls * Revert spurious preprocessing change * Revert spurious preprocessing change * Update rand_augment docstring * RandAugment failing due to sub-layers not handling labels * Rebased on top of add no-op branch * make randaugment subclass BaseImageAugmentationLayer * Reformat * Support kwargs * remove unused import * Add extra magnitude check * Reformat * tf.range bug? * Disable auto vectorize * Update RandAugment policies to support solarize sampling * Fix lint faulure * Update test case * Update rand augment demo and mildly tweak policy * Update RandAugment per feedback * update serialization test * Update stdev param name * Update seed * Update augmentated_sample -> augmented_sample * add rate to test coverage * add @tf.keras.utils.register_keras_serializable(package="keras_cv") * Add seed to constructor * Remove augmentation pipeline * Additional refactoring * add extra newline * Update to compile, update example * create demo of pipeline * Update to work with RandAugment * Update serialization test to include pipeline * Add custom layer to count invocations * Test pipeline test * format * Update unit test * What in the world is going on * Update to make test failures even more clear * Fix random_augmentation_pipeline * add seed back to random hue - weird * make unit tests pass * fix random augmentation pipeline demo * Update magnitude stddev * Wrote docstring * Fix typo * Update serialization, address scott comments * Francois comments * add clipping information * update docstring * Update docstring * Add f string
Example from the demo: