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

[TRANS, IMP] Add new max_size parameter to Resize #3494

Merged
merged 7 commits into from
Mar 4, 2021

Conversation

NicolasHug
Copy link
Member

@NicolasHug NicolasHug commented Mar 3, 2021

Addresses (part of) #2868

This PR adds a new max_size parameter to Resize. If the size of the resized image is greater than max_size, than the image is resized again to fit within max_size. This is similar to Detectron2's https://github.com/facebookresearch/detectron2/blob/911b091c23a29c624606475d6a2f345568d79e52/detectron2/data/transforms/augmentation_impl.py#L122

@NicolasHug NicolasHug changed the title WIP Add new max_size parameter to Resize [TRANS, IMP] Add new max_size parameter to Resize Mar 3, 2021
@codecov
Copy link

codecov bot commented Mar 3, 2021

Codecov Report

Merging #3494 (aa5162c) into master (7d41547) will increase coverage by 0.10%.
The diff coverage is 95.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3494      +/-   ##
==========================================
+ Coverage   78.65%   78.76%   +0.10%     
==========================================
  Files         105      105              
  Lines        9723     9723              
  Branches     1557     1561       +4     
==========================================
+ Hits         7648     7658      +10     
+ Misses       1583     1575       -8     
+ Partials      492      490       -2     
Impacted Files Coverage Δ
torchvision/transforms/functional_tensor.py 79.84% <90.47%> (+0.65%) ⬆️
torchvision/transforms/functional.py 81.77% <100.00%> (ø)
torchvision/transforms/functional_pil.py 68.12% <100.00%> (+0.51%) ⬆️
torchvision/transforms/transforms.py 84.30% <100.00%> (+0.02%) ⬆️
torchvision/datasets/utils.py 72.58% <0.00%> (+2.37%) ⬆️

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 7d41547...164c1ec. Read the comment docs.

Copy link
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@fmassa fmassa merged commit d4d36e6 into pytorch:master Mar 4, 2021
facebook-github-bot pushed a commit that referenced this pull request Mar 10, 2021
Summary:
* WIP, still needs tests and docs

* tests

* flake8

* Docs + fixed some tests

* proper error messages

Reviewed By: NicolasHug, cpuhrsch

Differential Revision: D26945732

fbshipit-source-id: 765c48af203ba27894881dea596f94d2f4a6794d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants