Skip to content

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