@@ -253,7 +253,7 @@ class Resize(torch.nn.Module):
253
253
the resized image: if the longer edge of the image is greater
254
254
than ``max_size`` after being resized according to ``size``, then
255
255
the image is resized again so that the longer edge is equal to
256
- ``max_size``. As a result, ``` size` might be overruled, i.e the
256
+ ``max_size``. As a result, ``size` ` might be overruled, i.e the
257
257
smaller edge may be shorter than ``size``. This is only supported
258
258
if ``size`` is an int (or a sequence of length 1 in torchscript
259
259
mode).
@@ -361,18 +361,16 @@ class Pad(torch.nn.Module):
361
361
362
362
- constant: pads with a constant value, this value is specified with fill
363
363
364
- - edge: pads with the last value at the edge of the image,
365
- if input a 5D torch Tensor, the last 3 dimensions will be padded instead of the last 2
364
+ - edge: pads with the last value at the edge of the image.
365
+ If input a 5D torch Tensor, the last 3 dimensions will be padded instead of the last 2
366
366
367
- - reflect: pads with reflection of image without repeating the last value on the edge
367
+ - reflect: pads with reflection of image without repeating the last value on the edge.
368
+ For example, padding [1, 2, 3, 4] with 2 elements on both sides in reflect mode
369
+ will result in [3, 2, 1, 2, 3, 4, 3, 2]
368
370
369
- For example, padding [1, 2, 3, 4] with 2 elements on both sides in reflect mode
370
- will result in [3, 2, 1, 2, 3, 4, 3, 2]
371
-
372
- - symmetric: pads with reflection of image repeating the last value on the edge
373
-
374
- For example, padding [1, 2, 3, 4] with 2 elements on both sides in symmetric mode
375
- will result in [2, 1, 1, 2, 3, 4, 4, 3]
371
+ - symmetric: pads with reflection of image repeating the last value on the edge.
372
+ For example, padding [1, 2, 3, 4] with 2 elements on both sides in symmetric mode
373
+ will result in [2, 1, 1, 2, 3, 4, 4, 3]
376
374
"""
377
375
378
376
def __init__ (self , padding , fill = 0 , padding_mode = "constant" ):
@@ -540,22 +538,21 @@ class RandomCrop(torch.nn.Module):
540
538
This value is only used when the padding_mode is constant.
541
539
Only number is supported for torch Tensor.
542
540
Only int or str or tuple value is supported for PIL Image.
543
- padding_mode (str): Type of padding. Should be: constant, edge, reflect or symmetric. Default is constant.
544
-
545
- - constant: pads with a constant value, this value is specified with fill
546
-
547
- - edge: pads with the last value on the edge of the image
548
-
549
- - reflect: pads with reflection of image (without repeating the last value on the edge)
541
+ padding_mode (str): Type of padding. Should be: constant, edge, reflect or symmetric.
542
+ Default is constant.
550
543
551
- padding [1, 2, 3, 4] with 2 elements on both sides in reflect mode
552
- will result in [3, 2, 1, 2, 3, 4, 3, 2]
544
+ - constant: pads with a constant value, this value is specified with fill
553
545
554
- - symmetric: pads with reflection of image (repeating the last value on the edge)
546
+ - edge: pads with the last value at the edge of the image.
547
+ If input a 5D torch Tensor, the last 3 dimensions will be padded instead of the last 2
555
548
556
- padding [1, 2, 3, 4] with 2 elements on both sides in symmetric mode
557
- will result in [2, 1, 1, 2, 3, 4, 4, 3]
549
+ - reflect: pads with reflection of image without repeating the last value on the edge.
550
+ For example, padding [1, 2, 3, 4] with 2 elements on both sides in reflect mode
551
+ will result in [3, 2, 1, 2, 3, 4, 3, 2]
558
552
553
+ - symmetric: pads with reflection of image repeating the last value on the edge.
554
+ For example, padding [1, 2, 3, 4] with 2 elements on both sides in symmetric mode
555
+ will result in [2, 1, 1, 2, 3, 4, 4, 3]
559
556
"""
560
557
561
558
@staticmethod
0 commit comments