Skip to content
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

Leave data_format as None in keras.ops.images and add data_format support to pad_images and crop_images #19774

Merged
merged 3 commits into from
May 29, 2024

Conversation

james77777778
Copy link
Contributor

@james77777778 james77777778 commented May 29, 2024

As titled.
This should follow the convention of keras.layers:
Leave data_format as None, and if not specified, set it to the value of keras.config.image_data_format.

Additionally, the logic of pad_images and crop_images have been updated to support data_format. With this PR, we can also process unknown shapes in pad_images (similar to ops.pad).
However, it is impossible to support fully unknown shapes in crop_images.

@codecov-commenter
Copy link

codecov-commenter commented May 29, 2024

Codecov Report

Attention: Patch coverage is 82.41758% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 73.10%. Comparing base (a243d91) to head (aabc537).

Files Patch % Lines
keras/src/ops/image.py 81.69% 7 Missing and 6 partials ⚠️
keras/src/backend/torch/image.py 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19774      +/-   ##
==========================================
- Coverage   78.56%   73.10%   -5.46%     
==========================================
  Files         498      498              
  Lines       45715    45742      +27     
  Branches     8440     8440              
==========================================
- Hits        35916    33440    -2476     
- Misses       8076    10654    +2578     
+ Partials     1723     1648      -75     
Flag Coverage Δ
keras 73.02% <82.41%> (-5.39%) ⬇️
keras-jax 62.13% <75.82%> (+0.01%) ⬆️
keras-numpy 56.40% <78.02%> (+0.02%) ⬆️
keras-tensorflow 63.44% <73.62%> (+0.01%) ⬆️
keras-torch ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good call

@fchollet fchollet merged commit 0eeba14 into keras-team:master May 29, 2024
6 checks passed
@google-ml-butler google-ml-butler bot added kokoro:force-run ready to pull Ready to be merged into the codebase labels May 29, 2024
@james77777778 james77777778 deleted the fix-data-format branch May 30, 2024 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kokoro:force-run ready to pull Ready to be merged into the codebase size:L
Projects
Status: Assigned Reviewer
Development

Successfully merging this pull request may close these issues.

4 participants