Skip to content

Commit f5c520b

Browse files
enkileeLigoml
andauthored
fix some typo errors (#48185)
* fix some typo errors function rotate: format errors. function to_grayscale: missing one sentences to explain num_output_chanels * Update functional.py * test=docs_preview * Update functional.py * Update functional.py * Update functional.py * Update functional.py * Update functional.py Co-authored-by: Ligoml <39876205+Ligoml@users.noreply.github.com>
1 parent 6dbfbfa commit f5c520b

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

python/paddle/vision/transforms/functional.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -269,18 +269,18 @@ def center_crop(img, output_size):
269269
PIL.Image or np.array: Cropped image.
270270
271271
Examples:
272-
.. code-block:: python
272+
.. code-block:: python
273273
274-
import numpy as np
275-
from PIL import Image
276-
from paddle.vision.transforms import functional as F
274+
import numpy as np
275+
from PIL import Image
276+
from paddle.vision.transforms import functional as F
277277
278-
fake_img = (np.random.rand(256, 300, 3) * 255.).astype('uint8')
278+
fake_img = (np.random.rand(256, 300, 3) * 255.).astype('uint8')
279279
280-
fake_img = Image.fromarray(fake_img)
280+
fake_img = Image.fromarray(fake_img)
281281
282-
cropped_img = F.center_crop(fake_img, (150, 100))
283-
print(cropped_img.size)
282+
cropped_img = F.center_crop(fake_img, (150, 100))
283+
print(cropped_img.size)
284284
"""
285285
if not (
286286
_is_pil_image(img) or _is_numpy_image(img) or _is_tensor_image(img)
@@ -764,7 +764,7 @@ def rotate(
764764
Origin is the upper left corner.
765765
Default is the center of the image.
766766
fill (3-list|3-tuple or int): RGB pixel fill value for area outside the rotated image.
767-
If int, it is used for all channels respectively.
767+
If int, it is used for all channels respectively. Default value is 0.
768768
769769
770770
Returns:
@@ -919,7 +919,8 @@ def to_grayscale(img, num_output_channels=1):
919919
920920
Args:
921921
img (PIL.Image|np.array): Image to be converted to grayscale.
922-
922+
num_output_channels (int, optional): The number of channels for the output
923+
image. Single channel. Default: 1.
923924
Returns:
924925
PIL.Image or np.array: Grayscale version of the image.
925926
if num_output_channels = 1 : returned image is single channel

0 commit comments

Comments
 (0)