@@ -709,7 +709,7 @@ def adjust_brightness(img: Tensor, brightness_factor: float) -> Tensor:
709
709
710
710
Args:
711
711
img (PIL Image or Tensor): Image to be adjusted.
712
- If img is a Tensor, it is expected to be in [..., 1 or 3, H, W] format,
712
+ If img is torch Tensor, it is expected to be in [..., 1 or 3, H, W] format,
713
713
where ... means it can have an arbitrary number of leading dimensions.
714
714
brightness_factor (float): How much to adjust the brightness. Can be
715
715
any non negative number. 0 gives a black image, 1 gives the
@@ -729,6 +729,8 @@ def adjust_contrast(img: Tensor, contrast_factor: float) -> Tensor:
729
729
730
730
Args:
731
731
img (PIL Image or Tensor): Image to be adjusted.
732
+ If img is torch Tensor, it is expected to be in [..., 3, H, W] format,
733
+ where ... means it can have an arbitrary number of leading dimensions.
732
734
contrast_factor (float): How much to adjust the contrast. Can be any
733
735
non negative number. 0 gives a solid gray image, 1 gives the
734
736
original image while 2 increases the contrast by a factor of 2.
@@ -747,6 +749,8 @@ def adjust_saturation(img: Tensor, saturation_factor: float) -> Tensor:
747
749
748
750
Args:
749
751
img (PIL Image or Tensor): Image to be adjusted.
752
+ If img is torch Tensor, it is expected to be in [..., 3, H, W] format,
753
+ where ... means it can have an arbitrary number of leading dimensions.
750
754
saturation_factor (float): How much to adjust the saturation. 0 will
751
755
give a black and white image, 1 will give the original image while
752
756
2 will enhance the saturation by a factor of 2.
@@ -776,6 +780,9 @@ def adjust_hue(img: Tensor, hue_factor: float) -> Tensor:
776
780
777
781
Args:
778
782
img (PIL Image or Tensor): Image to be adjusted.
783
+ If img is torch Tensor, it is expected to be in [..., 3, H, W] format,
784
+ where ... means it can have an arbitrary number of leading dimensions.
785
+ If img is PIL Image mode "1", "L", "I", "F" and modes with transparency (alpha channel) are not supported.
779
786
hue_factor (float): How much to shift the hue channel. Should be in
780
787
[-0.5, 0.5]. 0.5 and -0.5 give complete reversal of hue channel in
781
788
HSV space in positive and negative direction respectively.
@@ -806,8 +813,9 @@ def adjust_gamma(img: Tensor, gamma: float, gain: float = 1) -> Tensor:
806
813
807
814
Args:
808
815
img (PIL Image or Tensor): PIL Image to be adjusted.
809
- If img is a Tensor, it is expected to be in [..., 1 or 3, H, W] format,
816
+ If img is torch Tensor, it is expected to be in [..., 1 or 3, H, W] format,
810
817
where ... means it can have an arbitrary number of leading dimensions.
818
+ If img is PIL Image, modes with transparency (alpha channel) are not supported.
811
819
gamma (float): Non negative real number, same as :math:`\gamma` in the equation.
812
820
gamma larger than 1 make the shadows darker,
813
821
while gamma smaller than 1 make dark regions lighter.
@@ -1185,7 +1193,7 @@ def invert(img: Tensor) -> Tensor:
1185
1193
1186
1194
Args:
1187
1195
img (PIL Image or Tensor): Image to have its colors inverted.
1188
- If img is a Tensor, it is expected to be in [..., 1 or 3, H, W] format,
1196
+ If img is torch Tensor, it is expected to be in [..., 1 or 3, H, W] format,
1189
1197
where ... means it can have an arbitrary number of leading dimensions.
1190
1198
If img is PIL Image, it is expected to be in mode "L" or "RGB".
1191
1199
@@ -1203,7 +1211,7 @@ def posterize(img: Tensor, bits: int) -> Tensor:
1203
1211
1204
1212
Args:
1205
1213
img (PIL Image or Tensor): Image to have its colors posterized.
1206
- If img is a Tensor, it should be of type torch.uint8 and
1214
+ If img is torch Tensor, it should be of type torch.uint8 and
1207
1215
it is expected to be in [..., 1 or 3, H, W] format, where ... means
1208
1216
it can have an arbitrary number of leading dimensions.
1209
1217
If img is PIL Image, it is expected to be in mode "L" or "RGB".
@@ -1225,7 +1233,7 @@ def solarize(img: Tensor, threshold: float) -> Tensor:
1225
1233
1226
1234
Args:
1227
1235
img (PIL Image or Tensor): Image to have its colors inverted.
1228
- If img is a Tensor, it is expected to be in [..., 1 or 3, H, W] format,
1236
+ If img is torch Tensor, it is expected to be in [..., 1 or 3, H, W] format,
1229
1237
where ... means it can have an arbitrary number of leading dimensions.
1230
1238
If img is PIL Image, it is expected to be in mode "L" or "RGB".
1231
1239
threshold (float): All pixels equal or above this value are inverted.
@@ -1243,7 +1251,7 @@ def adjust_sharpness(img: Tensor, sharpness_factor: float) -> Tensor:
1243
1251
1244
1252
Args:
1245
1253
img (PIL Image or Tensor): Image to be adjusted.
1246
- If img is a Tensor, it is expected to be in [..., 1 or 3, H, W] format,
1254
+ If img is torch Tensor, it is expected to be in [..., 1 or 3, H, W] format,
1247
1255
where ... means it can have an arbitrary number of leading dimensions.
1248
1256
sharpness_factor (float): How much to adjust the sharpness. Can be
1249
1257
any non negative number. 0 gives a blurred image, 1 gives the
@@ -1265,7 +1273,7 @@ def autocontrast(img: Tensor) -> Tensor:
1265
1273
1266
1274
Args:
1267
1275
img (PIL Image or Tensor): Image on which autocontrast is applied.
1268
- If img is a Tensor, it is expected to be in [..., 1 or 3, H, W] format,
1276
+ If img is torch Tensor, it is expected to be in [..., 1 or 3, H, W] format,
1269
1277
where ... means it can have an arbitrary number of leading dimensions.
1270
1278
If img is PIL Image, it is expected to be in mode "L" or "RGB".
1271
1279
@@ -1285,7 +1293,7 @@ def equalize(img: Tensor) -> Tensor:
1285
1293
1286
1294
Args:
1287
1295
img (PIL Image or Tensor): Image on which equalize is applied.
1288
- If img is a Tensor, it is expected to be in [..., 1 or 3, H, W] format,
1296
+ If img is torch Tensor, it is expected to be in [..., 1 or 3, H, W] format,
1289
1297
where ... means it can have an arbitrary number of leading dimensions.
1290
1298
If img is PIL Image, it is expected to be in mode "P", "L" or "RGB".
1291
1299
0 commit comments