-
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
implement transform_bounding_boxes for random_zoom #20526
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #20526 +/- ##
==========================================
+ Coverage 82.10% 82.14% +0.04%
==========================================
Files 515 515
Lines 47790 47854 +64
Branches 7486 7493 +7
==========================================
+ Hits 39238 39312 +74
+ Misses 6738 6730 -8
+ Partials 1814 1812 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
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.
The code looks great! Please add a unit test.
# Conflicts: # keras/src/layers/preprocessing/image_preprocessing/random_zoom.py # keras/src/layers/preprocessing/image_preprocessing/random_zoom_test.py
This reverts commit 3288fc7.
I've added test cases. If there are any corrections needed, please feel free to share them with me. |
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! The tests are looking good.
if backend_utils.in_tf_graph(): | ||
self.backend.set_backend("tensorflow") | ||
|
||
def _get_transformed_x_y(x, y, transform): |
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.
Please move the functions _get_transformed_x_y
and _get_clipped_bbox
to be methods on the layer class rather than inlined function (for better eager performance).
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.
I have moved these functions to layer class. Thank you for your guidance.
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, thank you!
I have implemented the transform_bounding_boxes method to support random zoom functionality. If this implementation is satisfactory, I can proceed with adding corresponding test cases.
here is gist