@@ -52,10 +52,10 @@ class ImageReadMode(Enum):
52
52
"""
53
53
Support for various modes while reading images.
54
54
55
- Use `ImageReadMode.UNCHANGED` for loading the image as-is,
56
- `ImageReadMode.GRAY` for converting to grayscale,
57
- `ImageReadMode.GRAY_ALPHA` for grayscale with transparency,
58
- `ImageReadMode.RGB` for RGB and `ImageReadMode.RGB_ALPHA` for
55
+ Use `` ImageReadMode.UNCHANGED` ` for loading the image as-is,
56
+ `` ImageReadMode.GRAY` ` for converting to grayscale,
57
+ `` ImageReadMode.GRAY_ALPHA` ` for grayscale with transparency,
58
+ `` ImageReadMode.RGB`` for RGB and `` ImageReadMode.RGB_ALPHA` ` for
59
59
RGB with transparency.
60
60
"""
61
61
UNCHANGED = 0
@@ -102,7 +102,7 @@ def decode_png(input: torch.Tensor, mode: ImageReadMode = ImageReadMode.UNCHANGE
102
102
input (Tensor[1]): a one dimensional uint8 tensor containing
103
103
the raw bytes of the PNG image.
104
104
mode (ImageReadMode): the read mode used for optionally
105
- converting the image. Default: `ImageReadMode.UNCHANGED`.
105
+ converting the image. Default: `` ImageReadMode.UNCHANGED` `.
106
106
See `ImageReadMode` class for more information on various
107
107
available modes.
108
108
@@ -120,7 +120,7 @@ def encode_png(input: torch.Tensor, compression_level: int = 6) -> torch.Tensor:
120
120
121
121
Args:
122
122
input (Tensor[channels, image_height, image_width]): int8 image tensor of
123
- `c` channels, where `c ` must 3 or 1.
123
+ ``c`` channels, where ``c` ` must 3 or 1.
124
124
compression_level (int): Compression factor for the resulting file, it must be a number
125
125
between 0 and 9. Default: 6
126
126
@@ -139,7 +139,7 @@ def write_png(input: torch.Tensor, filename: str, compression_level: int = 6):
139
139
140
140
Args:
141
141
input (Tensor[channels, image_height, image_width]): int8 image tensor of
142
- `c` channels, where `c ` must be 1 or 3.
142
+ ``c`` channels, where ``c` ` must be 1 or 3.
143
143
filename (str): Path to save the image.
144
144
compression_level (int): Compression factor for the resulting file, it must be a number
145
145
between 0 and 9. Default: 6
@@ -160,8 +160,8 @@ def decode_jpeg(input: torch.Tensor, mode: ImageReadMode = ImageReadMode.UNCHANG
160
160
the raw bytes of the JPEG image. This tensor must be on CPU,
161
161
regardless of the ``device`` parameter.
162
162
mode (ImageReadMode): the read mode used for optionally
163
- converting the image. Default: `ImageReadMode.UNCHANGED`.
164
- See `ImageReadMode` class for more information on various
163
+ converting the image. Default: `` ImageReadMode.UNCHANGED` `.
164
+ See `` ImageReadMode` ` class for more information on various
165
165
available modes.
166
166
device (str or torch.device): The device on which the decoded image will
167
167
be stored. If a cuda device is specified, the image will be decoded
@@ -186,7 +186,7 @@ def encode_jpeg(input: torch.Tensor, quality: int = 75) -> torch.Tensor:
186
186
187
187
Args:
188
188
input (Tensor[channels, image_height, image_width])): int8 image tensor of
189
- `c` channels, where `c ` must be 1 or 3.
189
+ ``c`` channels, where ``c` ` must be 1 or 3.
190
190
quality (int): Quality of the resulting JPEG file, it must be a number between
191
191
1 and 100. Default: 75
192
192
@@ -207,8 +207,8 @@ def write_jpeg(input: torch.Tensor, filename: str, quality: int = 75):
207
207
Takes an input tensor in CHW layout and saves it in a JPEG file.
208
208
209
209
Args:
210
- input (Tensor[channels, image_height, image_width]): int8 image tensor of `c `
211
- channels, where `c ` must be 1 or 3.
210
+ input (Tensor[channels, image_height, image_width]): int8 image tensor of ``c` `
211
+ channels, where ``c` ` must be 1 or 3.
212
212
filename (str): Path to save the image.
213
213
quality (int): Quality of the resulting JPEG file, it must be a number
214
214
between 1 and 100. Default: 75
@@ -229,8 +229,8 @@ def decode_image(input: torch.Tensor, mode: ImageReadMode = ImageReadMode.UNCHAN
229
229
input (Tensor): a one dimensional uint8 tensor containing the raw bytes of the
230
230
PNG or JPEG image.
231
231
mode (ImageReadMode): the read mode used for optionally converting the image.
232
- Default: `ImageReadMode.UNCHANGED`.
233
- See `ImageReadMode` class for more information on various
232
+ Default: `` ImageReadMode.UNCHANGED` `.
233
+ See `` ImageReadMode` ` class for more information on various
234
234
available modes.
235
235
236
236
Returns:
@@ -249,8 +249,8 @@ def read_image(path: str, mode: ImageReadMode = ImageReadMode.UNCHANGED) -> torc
249
249
Args:
250
250
path (str): path of the JPEG or PNG image.
251
251
mode (ImageReadMode): the read mode used for optionally converting the image.
252
- Default: `ImageReadMode.UNCHANGED`.
253
- See `ImageReadMode` class for more information on various
252
+ Default: `` ImageReadMode.UNCHANGED` `.
253
+ See `` ImageReadMode` ` class for more information on various
254
254
available modes.
255
255
256
256
Returns:
0 commit comments