-
Notifications
You must be signed in to change notification settings - Fork 19.5k
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
Add rand_augment processing layer #20716
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #20716 +/- ##
==========================================
+ Coverage 81.83% 81.95% +0.11%
==========================================
Files 552 553 +1
Lines 51363 51437 +74
Branches 7944 7953 +9
==========================================
+ Hits 42034 42155 +121
+ Misses 7375 7346 -29
+ Partials 1954 1936 -18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Thank you for the PR!
keras/src/layers/preprocessing/image_preprocessing/rand_augment.py
Outdated
Show resolved
Hide resolved
keras/src/layers/preprocessing/image_preprocessing/rand_augment.py
Outdated
Show resolved
Hide resolved
keras/src/layers/preprocessing/image_preprocessing/rand_augment.py
Outdated
Show resolved
Hide resolved
keras/src/layers/preprocessing/image_preprocessing/rand_augment.py
Outdated
Show resolved
Hide resolved
keras/src/layers/preprocessing/image_preprocessing/rand_augment.py
Outdated
Show resolved
Hide resolved
keras/src/layers/preprocessing/image_preprocessing/rand_augment.py
Outdated
Show resolved
Hide resolved
keras/src/layers/preprocessing/image_preprocessing/rand_augment.py
Outdated
Show resolved
Hide resolved
@fchollet |
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.
Wonderful -- thanks for the great work! LGTM
* Specify window_length dtype requirement in tf.keras.ops.istft in math.py (#20728) The `window_length` parameter in `tf.keras.ops.istft` requires `tf.int32` dtype, but this isn't documented. This can cause unexpected `ValueError` when using `tf.int64` and `tf.int16` Here is the Example case: ``` import tensorflow as tf input_dict = { 'stfts': tf.constant([[-0.87817144+1.14583987j, -0.32066484+0.25565411j]], dtype=tf.complex128), 'frame_length': tf.constant(256, dtype=tf.int16), 'frame_step': tf.constant(5120,dtype=tf.int64) } result = tf.signal.inverse_stft(**input_dict) print(result) ``` The code throws the following error: ``` ValueError: window_length: Tensor conversion requested dtype int32 for Tensor with dtype int64 ``` * Add rand_augment processing layer (#20716) * Add rand_augment init * Update rand_augment init * Add rand_augment * Add NotImplementedError * Add some test cases * Fix failed test case * Update rand_augment * Update rand_augment test * Fix random_rotation bug * Add build method to supress warning. * Add implementation for transform_bboxes * Fixing batch_dim_name attribute (#20674) * fixing wrong trainer assumption that batch dim is always the first one in the mesh * need functools partial * lint * fix test failure when distribution=None * lint2 * fix for test failure * added data sharding for 3D+ meshes * lint3 * added @Property for batch_dim_name + refactoring * fix typo * Add support for `dtype` / `DTypePolicy` to `JaxLayer` and `FlaxLayer`. (#20732) The `dtype` / `DTypePolicy` is applied to all float variables. * Allow dynamic shape in `STFTSpectrogram` layer. (#20736) by simply using `ops.shape(x)` instead of `x.shape`. * Remove duplicate export tests in `model_test`. (#20735) The same tests exist at: - https://github.com/keras-team/keras/blob/master/keras/src/export/saved_model_test.py#L66 - https://github.com/keras-team/keras/blob/master/keras/src/export/onnx_test.py#L62 The goal is to isolate the use of `onnxruntime` to a single file, `onnx_test.py`. * Add OpenVINO into README.md (#20739) * Add OpenVINO into README.md Signed-off-by: Kazantsev, Roman <[email protected]> * Update README.md --------- Signed-off-by: Kazantsev, Roman <[email protected]> * Multiple Example Title has removed in metrics.MeanIoU method (#20738) Multiple Example Title has removed in metrics.MeanIoU method --------- Signed-off-by: Kazantsev, Roman <[email protected]> Co-authored-by: LakshmiKalaKadali <[email protected]> Co-authored-by: Ugeun Park <[email protected]> Co-authored-by: Martin Görner <[email protected]> Co-authored-by: hertschuh <[email protected]> Co-authored-by: Roman Kazantsev <[email protected]> Co-authored-by: LavanyaKV1234 <[email protected]>
* Specify window_length dtype requirement in tf.keras.ops.istft in math.py (#20728) The `window_length` parameter in `tf.keras.ops.istft` requires `tf.int32` dtype, but this isn't documented. This can cause unexpected `ValueError` when using `tf.int64` and `tf.int16` Here is the Example case: ``` import tensorflow as tf input_dict = { 'stfts': tf.constant([[-0.87817144+1.14583987j, -0.32066484+0.25565411j]], dtype=tf.complex128), 'frame_length': tf.constant(256, dtype=tf.int16), 'frame_step': tf.constant(5120,dtype=tf.int64) } result = tf.signal.inverse_stft(**input_dict) print(result) ``` The code throws the following error: ``` ValueError: window_length: Tensor conversion requested dtype int32 for Tensor with dtype int64 ``` * Add rand_augment processing layer (#20716) * Add rand_augment init * Update rand_augment init * Add rand_augment * Add NotImplementedError * Add some test cases * Fix failed test case * Update rand_augment * Update rand_augment test * Fix random_rotation bug * Add build method to supress warning. * Add implementation for transform_bboxes * Fixing batch_dim_name attribute (#20674) * fixing wrong trainer assumption that batch dim is always the first one in the mesh * need functools partial * lint * fix test failure when distribution=None * lint2 * fix for test failure * added data sharding for 3D+ meshes * lint3 * added @Property for batch_dim_name + refactoring * fix typo * Add support for `dtype` / `DTypePolicy` to `JaxLayer` and `FlaxLayer`. (#20732) The `dtype` / `DTypePolicy` is applied to all float variables. * Allow dynamic shape in `STFTSpectrogram` layer. (#20736) by simply using `ops.shape(x)` instead of `x.shape`. * Remove duplicate export tests in `model_test`. (#20735) The same tests exist at: - https://github.com/keras-team/keras/blob/master/keras/src/export/saved_model_test.py#L66 - https://github.com/keras-team/keras/blob/master/keras/src/export/onnx_test.py#L62 The goal is to isolate the use of `onnxruntime` to a single file, `onnx_test.py`. * Add OpenVINO into README.md (#20739) * Add OpenVINO into README.md Signed-off-by: Kazantsev, Roman <[email protected]> * Update README.md --------- Signed-off-by: Kazantsev, Roman <[email protected]> * Multiple Example Title has removed in metrics.MeanIoU method (#20738) Multiple Example Title has removed in metrics.MeanIoU method --------- Signed-off-by: Kazantsev, Roman <[email protected]> Co-authored-by: LakshmiKalaKadali <[email protected]> Co-authored-by: Ugeun Park <[email protected]> Co-authored-by: Martin Görner <[email protected]> Co-authored-by: hertschuh <[email protected]> Co-authored-by: Roman Kazantsev <[email protected]> Co-authored-by: LavanyaKV1234 <[email protected]>
I have implemented the transform_images method in the RandAugment image processing layer. If this pull request is accepted, I can proceed with implementing the transform_bounding_boxes method as well.
here is my gist