@@ -35,7 +35,12 @@ def _get_image_num_channels(img: Any) -> int:
35
35
36
36
@torch .jit .unused
37
37
def hflip (img ):
38
- """Horizontally flip the given PIL Image.
38
+ """PRIVATE METHOD. Horizontally flip the given PIL Image.
39
+
40
+ .. warning::
41
+
42
+ Module ``transforms.functional_pil`` is private and should not be used in user application.
43
+ Please, consider instead using methods from `transforms.functional` module.
39
44
40
45
Args:
41
46
img (PIL Image): Image to be flipped.
@@ -51,7 +56,12 @@ def hflip(img):
51
56
52
57
@torch .jit .unused
53
58
def vflip (img ):
54
- """Vertically flip the given PIL Image.
59
+ """PRIVATE METHOD. Vertically flip the given PIL Image.
60
+
61
+ .. warning::
62
+
63
+ Module ``transforms.functional_pil`` is private and should not be used in user application.
64
+ Please, consider instead using methods from `transforms.functional` module.
55
65
56
66
Args:
57
67
img (PIL Image): Image to be flipped.
@@ -67,7 +77,12 @@ def vflip(img):
67
77
68
78
@torch .jit .unused
69
79
def adjust_brightness (img , brightness_factor ):
70
- """Adjust brightness of an RGB image.
80
+ """PRIVATE METHOD. Adjust brightness of an RGB image.
81
+
82
+ .. warning::
83
+
84
+ Module ``transforms.functional_pil`` is private and should not be used in user application.
85
+ Please, consider instead using methods from `transforms.functional` module.
71
86
72
87
Args:
73
88
img (PIL Image): Image to be adjusted.
@@ -88,7 +103,13 @@ def adjust_brightness(img, brightness_factor):
88
103
89
104
@torch .jit .unused
90
105
def adjust_contrast (img , contrast_factor ):
91
- """Adjust contrast of an Image.
106
+ """PRIVATE METHOD. Adjust contrast of an Image.
107
+
108
+ .. warning::
109
+
110
+ Module ``transforms.functional_pil`` is private and should not be used in user application.
111
+ Please, consider instead using methods from `transforms.functional` module.
112
+
92
113
Args:
93
114
img (PIL Image): PIL Image to be adjusted.
94
115
contrast_factor (float): How much to adjust the contrast. Can be any
@@ -107,7 +128,13 @@ def adjust_contrast(img, contrast_factor):
107
128
108
129
@torch .jit .unused
109
130
def adjust_saturation (img , saturation_factor ):
110
- """Adjust color saturation of an image.
131
+ """PRIVATE METHOD. Adjust color saturation of an image.
132
+
133
+ .. warning::
134
+
135
+ Module ``transforms.functional_pil`` is private and should not be used in user application.
136
+ Please, consider instead using methods from `transforms.functional` module.
137
+
111
138
Args:
112
139
img (PIL Image): PIL Image to be adjusted.
113
140
saturation_factor (float): How much to adjust the saturation. 0 will
@@ -126,7 +153,12 @@ def adjust_saturation(img, saturation_factor):
126
153
127
154
@torch .jit .unused
128
155
def adjust_hue (img , hue_factor ):
129
- """Adjust hue of an image.
156
+ """PRIVATE METHOD. Adjust hue of an image.
157
+
158
+ .. warning::
159
+
160
+ Module ``transforms.functional_pil`` is private and should not be used in user application.
161
+ Please, consider instead using methods from `transforms.functional` module.
130
162
131
163
The image hue is adjusted by converting the image to HSV and
132
164
cyclically shifting the intensities in the hue channel (H).
@@ -174,7 +206,12 @@ def adjust_hue(img, hue_factor):
174
206
175
207
@torch .jit .unused
176
208
def adjust_gamma (img , gamma , gain = 1 ):
177
- r"""Perform gamma correction on an image.
209
+ r"""PRIVATE METHOD. Perform gamma correction on an image.
210
+
211
+ .. warning::
212
+
213
+ Module ``transforms.functional_pil`` is private and should not be used in user application.
214
+ Please, consider instead using methods from `transforms.functional` module.
178
215
179
216
Also known as Power Law Transform. Intensities in RGB mode are adjusted
180
217
based on the following equation:
@@ -210,7 +247,12 @@ def adjust_gamma(img, gamma, gain=1):
210
247
211
248
@torch .jit .unused
212
249
def pad (img , padding , fill = 0 , padding_mode = "constant" ):
213
- r"""Pad the given PIL.Image on all sides with the given "pad" value.
250
+ r"""PRIVATE METHOD. Pad the given PIL.Image on all sides with the given "pad" value.
251
+
252
+ .. warning::
253
+
254
+ Module ``transforms.functional_pil`` is private and should not be used in user application.
255
+ Please, consider instead using methods from `transforms.functional` module.
214
256
215
257
Args:
216
258
img (PIL Image): Image to be padded.
@@ -309,7 +351,12 @@ def pad(img, padding, fill=0, padding_mode="constant"):
309
351
310
352
@torch .jit .unused
311
353
def crop (img : Image .Image , top : int , left : int , height : int , width : int ) -> Image .Image :
312
- """Crop the given PIL Image.
354
+ """PRIVATE METHOD. Crop the given PIL Image.
355
+
356
+ .. warning::
357
+
358
+ Module ``transforms.functional_pil`` is private and should not be used in user application.
359
+ Please, consider instead using methods from `transforms.functional` module.
313
360
314
361
Args:
315
362
img (PIL Image): Image to be cropped. (0,0) denotes the top left corner of the image.
@@ -329,7 +376,12 @@ def crop(img: Image.Image, top: int, left: int, height: int, width: int) -> Imag
329
376
330
377
@torch .jit .unused
331
378
def resize (img , size , interpolation = Image .BILINEAR ):
332
- r"""Resize the input PIL Image to the given size.
379
+ r"""PRIVATE METHOD. Resize the input PIL Image to the given size.
380
+
381
+ .. warning::
382
+
383
+ Module ``transforms.functional_pil`` is private and should not be used in user application.
384
+ Please, consider instead using methods from `transforms.functional` module.
333
385
334
386
Args:
335
387
img (PIL Image): Image to be resized.
@@ -370,7 +422,12 @@ def resize(img, size, interpolation=Image.BILINEAR):
370
422
371
423
@torch .jit .unused
372
424
def _parse_fill (fill , img , min_pil_version , name = "fillcolor" ):
373
- """Helper function to get the fill color for rotate, perspective transforms, and pad.
425
+ """PRIVATE METHOD. Helper function to get the fill color for rotate, perspective transforms, and pad.
426
+
427
+ .. warning::
428
+
429
+ Module ``transforms.functional_pil`` is private and should not be used in user application.
430
+ Please, consider instead using methods from `transforms.functional` module.
374
431
375
432
Args:
376
433
fill (n-tuple or int or float): Pixel fill value for area outside the transformed
@@ -409,7 +466,12 @@ def _parse_fill(fill, img, min_pil_version, name="fillcolor"):
409
466
410
467
@torch .jit .unused
411
468
def affine (img , matrix , resample = 0 , fillcolor = None ):
412
- """Apply affine transformation on the PIL Image keeping image center invariant.
469
+ """PRIVATE METHOD. Apply affine transformation on the PIL Image keeping image center invariant.
470
+
471
+ .. warning::
472
+
473
+ Module ``transforms.functional_pil`` is private and should not be used in user application.
474
+ Please, consider instead using methods from `transforms.functional` module.
413
475
414
476
Args:
415
477
img (PIL Image): image to be rotated.
@@ -433,7 +495,12 @@ def affine(img, matrix, resample=0, fillcolor=None):
433
495
434
496
@torch .jit .unused
435
497
def rotate (img , angle , resample = 0 , expand = False , center = None , fill = None ):
436
- """Rotate PIL image by angle.
498
+ """PRIVATE METHOD. Rotate PIL image by angle.
499
+
500
+ .. warning::
501
+
502
+ Module ``transforms.functional_pil`` is private and should not be used in user application.
503
+ Please, consider instead using methods from `transforms.functional` module.
437
504
438
505
Args:
439
506
img (PIL Image): image to be rotated.
@@ -467,7 +534,12 @@ def rotate(img, angle, resample=0, expand=False, center=None, fill=None):
467
534
468
535
@torch .jit .unused
469
536
def perspective (img , perspective_coeffs , interpolation = Image .BICUBIC , fill = None ):
470
- """Perform perspective transform of the given PIL Image.
537
+ """PRIVATE METHOD. Perform perspective transform of the given PIL Image.
538
+
539
+ .. warning::
540
+
541
+ Module ``transforms.functional_pil`` is private and should not be used in user application.
542
+ Please, consider instead using methods from `transforms.functional` module.
471
543
472
544
Args:
473
545
img (PIL Image): Image to be transformed.
@@ -491,7 +563,12 @@ def perspective(img, perspective_coeffs, interpolation=Image.BICUBIC, fill=None)
491
563
492
564
@torch .jit .unused
493
565
def to_grayscale (img , num_output_channels ):
494
- """Convert PIL image of any mode (RGB, HSV, LAB, etc) to grayscale version of image.
566
+ """PRIVATE METHOD. Convert PIL image of any mode (RGB, HSV, LAB, etc) to grayscale version of image.
567
+
568
+ .. warning::
569
+
570
+ Module ``transforms.functional_pil`` is private and should not be used in user application.
571
+ Please, consider instead using methods from `transforms.functional` module.
495
572
496
573
Args:
497
574
img (PIL Image): Image to be converted to grayscale.
0 commit comments