Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
6cfd2ae1
Commit
6cfd2ae1
authored
May 24, 2018
by
vfdev
Committed by
Francisco Massa
May 24, 2018
Browse files
Fix transforms.Pad and transforms.LinearTransformation doc strings (#511)
parent
55d73951
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
torchvision/transforms/transforms.py
torchvision/transforms/transforms.py
+16
-9
No files found.
torchvision/transforms/transforms.py
View file @
6cfd2ae1
...
@@ -227,17 +227,24 @@ class Pad(object):
...
@@ -227,17 +227,24 @@ class Pad(object):
on left/right and top/bottom respectively. If a tuple of length 4 is provided
on left/right and top/bottom respectively. If a tuple of length 4 is provided
this is the padding for the left, top, right and bottom borders
this is the padding for the left, top, right and bottom borders
respectively.
respectively.
fill: Pixel fill value for constant fill. Default is 0. If a tuple of
fill
(int or tuple)
: Pixel fill value for constant fill. Default is 0. If a tuple of
length 3, it is used to fill R, G, B channels respectively.
length 3, it is used to fill R, G, B channels respectively.
This value is only used when the padding_mode is constant
This value is only used when the padding_mode is constant
padding_mode: Type of padding. Should be: constant, edge, reflect or symmetric. Default is constant.
padding_mode (str): Type of padding. Should be: constant, edge, reflect or symmetric.
constant: pads with a constant value, this value is specified with fill
Default is constant.
edge: pads with the last value at the edge of the image
reflect: pads with reflection of image (without repeating the last value on the edge)
- constant: pads with a constant value, this value is specified with fill
padding [1, 2, 3, 4] with 2 elements on both sides in reflect mode
- edge: pads with the last value at the edge of the image
- reflect: pads with reflection of image without repeating the last value on the edge
For example, padding [1, 2, 3, 4] with 2 elements on both sides in reflect mode
will result in [3, 2, 1, 2, 3, 4, 3, 2]
will result in [3, 2, 1, 2, 3, 4, 3, 2]
symmetric: pads with reflection of image (repeating the last value on the edge)
padding [1, 2, 3, 4] with 2 elements on both sides in symmetric mode
- symmetric: pads with reflection of image repeating the last value on the edge
For example, padding [1, 2, 3, 4] with 2 elements on both sides in symmetric mode
will result in [2, 1, 1, 2, 3, 4, 4, 3]
will result in [2, 1, 1, 2, 3, 4, 4, 3]
"""
"""
...
@@ -655,7 +662,7 @@ class LinearTransformation(object):
...
@@ -655,7 +662,7 @@ class LinearTransformation(object):
original shape.
original shape.
Applications:
Applications:
- whitening: zero-center the data, compute the data covariance matrix
- whitening: zero-center the data, compute the data covariance matrix
[D x D] with np.dot(X.T, X), perform SVD on this matrix and
[D x D] with np.dot(X.T, X), perform SVD on this matrix and
pass it as transformation_matrix.
pass it as transformation_matrix.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment