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: Fixed Resize transfo in PyTorch when aspect ratio matches the target #357

Merged
merged 2 commits into from
Jul 6, 2021

Conversation

fg-mindee
Copy link
Contributor

In rare cases, when the original image has the same aspect ratio as the target size, the resize was not performed correctly. This PR fixes that and adds a test case in corresponding pytorch unittests.

Any feedback is welcome!

@fg-mindee fg-mindee added type: bug Something isn't working ext: tests Related to tests folder module: transforms Related to doctr.transforms framework: pytorch Related to PyTorch backend labels Jul 6, 2021
@fg-mindee fg-mindee added this to the 0.3.1 milestone Jul 6, 2021
@fg-mindee fg-mindee self-assigned this Jul 6, 2021
@codecov
Copy link

codecov bot commented Jul 6, 2021

Codecov Report

Merging #357 (6cb0734) into main (9098e16) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #357      +/-   ##
==========================================
- Coverage   96.09%   96.06%   -0.03%     
==========================================
  Files          83       83              
  Lines        3404     3404              
==========================================
- Hits         3271     3270       -1     
- Misses        133      134       +1     
Flag Coverage Δ
unittests 96.06% <100.00%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
doctr/transforms/modules/pytorch.py 100.00% <100.00%> (ø)
...dels/detection/differentiable_binarization/base.py 91.08% <0.00%> (-0.64%) ⬇️

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 9098e16...6cb0734. Read the comment docs.

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

@fg-mindee fg-mindee merged commit d7f50b5 into main Jul 6, 2021
@fg-mindee fg-mindee deleted the torch-resize branch July 6, 2021 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ext: tests Related to tests folder framework: pytorch Related to PyTorch backend 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