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

fix: Prevents rounding errors in RandomCrop #473

Merged
merged 1 commit into from
Sep 15, 2021
Merged

fix: Prevents rounding errors in RandomCrop #473

merged 1 commit into from
Sep 15, 2021

Conversation

fg-mindee
Copy link
Contributor

In very rare cases, the generated coordinates of the crop from RandomCrop were out of bounds (negative usually). This PR ensures that proper rounding is used and adds clipping to avoid issues.

Any feedback is welcome!

@fg-mindee fg-mindee added type: bug Something isn't working module: transforms Related to doctr.transforms labels Sep 15, 2021
@fg-mindee fg-mindee added this to the 0.4.0 milestone Sep 15, 2021
@fg-mindee fg-mindee self-assigned this Sep 15, 2021
@fg-mindee fg-mindee changed the title fix: Prevents rounding errors in cropping fix: Prevents rounding errors in RandomCrop Sep 15, 2021
Copy link
Collaborator

@charlesmindee charlesmindee left a comment

Choose a reason for hiding this comment

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

Thanks!

@codecov
Copy link

codecov bot commented Sep 15, 2021

Codecov Report

Merging #473 (28d1474) into main (342239a) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #473   +/-   ##
=======================================
  Coverage   95.36%   95.36%           
=======================================
  Files          96       96           
  Lines        4053     4053           
=======================================
  Hits         3865     3865           
  Misses        188      188           
Flag Coverage Δ
unittests 95.36% <100.00%> (ø)

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

Impacted Files Coverage Δ
doctr/transforms/modules/base.py 91.22% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fec8be...28d1474. Read the comment docs.

@fg-mindee fg-mindee merged commit cfc329f into main Sep 15, 2021
@fg-mindee fg-mindee deleted the crop-fix branch September 15, 2021 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: transforms Related to doctr.transforms type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants