keras-team / keras

Deep Learning for humans
http://keras.io/
Apache License 2.0
62.12k stars 19.49k forks source link

implement transform_bounding_boxes for center_crop #20491

Closed shashaka closed 1 week ago

shashaka commented 1 week ago

I implemented the transform_bounding_boxes method to handle center cropping. Could you please review my code and let me know if there are any corrections or improvements needed?

here is gist

codecov-commenter commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 82.08%. Comparing base (96e07ec) to head (5f0fac6). Report is 5 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #20491 +/- ## ========================================= Coverage 82.08% 82.08% ========================================= Files 515 515 Lines 47543 47670 +127 Branches 7455 8534 +1079 ========================================= + Hits 39024 39132 +108 - Misses 6709 6721 +12 - Partials 1810 1817 +7 ``` | [Flag](https://app.codecov.io/gh/keras-team/keras/pull/20491/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | Coverage Δ | | |---|---|---| | [keras](https://app.codecov.io/gh/keras-team/keras/pull/20491/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `81.94% <98.18%> (+<0.01%)` | :arrow_up: | | [keras-jax](https://app.codecov.io/gh/keras-team/keras/pull/20491/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `65.03% <94.54%> (+<0.01%)` | :arrow_up: | | [keras-numpy](https://app.codecov.io/gh/keras-team/keras/pull/20491/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `59.98% <94.54%> (-0.01%)` | :arrow_down: | | [keras-tensorflow](https://app.codecov.io/gh/keras-team/keras/pull/20491/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `66.01% <94.54%> (-0.03%)` | :arrow_down: | | [keras-torch](https://app.codecov.io/gh/keras-team/keras/pull/20491/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `64.95% <94.54%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

divyashreepathihalli commented 1 week ago

Thanks @shashaka can you please add a demo colab to show single image and batched image and bbox transformation.

shashaka commented 1 week ago

@divyashreepathihalli I updated my gist to include demo for single image and batched one.

shashaka commented 1 week ago

I've added unit tests for this. Please let me know if any updates are needed.