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

Update transform doc with random offset of padding due to pad_if_needed #791

Merged
merged 2 commits into from
Mar 11, 2019
Merged

Update transform doc with random offset of padding due to pad_if_needed #791

merged 2 commits into from
Mar 11, 2019

Conversation

ekagra-ranjan
Copy link
Contributor

@ekagra-ranjan ekagra-ranjan commented Mar 10, 2019

In reference to #562 and #564 updating transform docs with the random offset of padding when pad_if_needed is set to True.

Updating transform docs with the random offset of padding when pad_if_needed is set to True.
@codecov-io
Copy link

codecov-io commented Mar 10, 2019

Codecov Report

Merging #791 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #791   +/-   ##
======================================
  Coverage    38.1%   38.1%           
======================================
  Files          32      32           
  Lines        3128    3128           
  Branches      488     488           
======================================
  Hits         1192    1192           
  Misses       1857    1857           
  Partials       79      79
Impacted Files Coverage Δ
torchvision/transforms/transforms.py 83.41% <ø> (ø) ⬆️

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 138b5c2...ef2672c. 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.

The padding itself is not random:

if self.pad_if_needed and img.size[0] < self.size[1]:
img = F.pad(img, (self.size[1] - img.size[0], 0), self.fill, self.padding_mode)
# pad the height if needed
if self.pad_if_needed and img.size[1] < self.size[0]:
img = F.pad(img, (0, self.size[0] - img.size[1]), self.fill, self.padding_mode)

but because we perform random crops, the padded area might be present in a seemly random position.

Maybe there is a way of clarifying this in the 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.

Thanks!

@fmassa fmassa merged commit 8257aff into pytorch:master Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants