未验证 提交 f5c520bb 编写于 作者: I Infinity_lee 提交者: GitHub

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: NLigoml <39876205+Ligoml@users.noreply.github.com>
上级 6dbfbfa5
......@@ -269,18 +269,18 @@ def center_crop(img, output_size):
PIL.Image or np.array: Cropped image.
Examples:
.. code-block:: python
.. code-block:: python
import numpy as np
from PIL import Image
from paddle.vision.transforms import functional as F
import numpy as np
from PIL import Image
from paddle.vision.transforms import functional as F
fake_img = (np.random.rand(256, 300, 3) * 255.).astype('uint8')
fake_img = (np.random.rand(256, 300, 3) * 255.).astype('uint8')
fake_img = Image.fromarray(fake_img)
fake_img = Image.fromarray(fake_img)
cropped_img = F.center_crop(fake_img, (150, 100))
print(cropped_img.size)
cropped_img = F.center_crop(fake_img, (150, 100))
print(cropped_img.size)
"""
if not (
_is_pil_image(img) or _is_numpy_image(img) or _is_tensor_image(img)
......@@ -764,7 +764,7 @@ def rotate(
Origin is the upper left corner.
Default is the center of the image.
fill (3-list|3-tuple or int): RGB pixel fill value for area outside the rotated image.
If int, it is used for all channels respectively.
If int, it is used for all channels respectively. Default value is 0.
Returns:
......@@ -919,7 +919,8 @@ def to_grayscale(img, num_output_channels=1):
Args:
img (PIL.Image|np.array): Image to be converted to grayscale.
num_output_channels (int, optional): The number of channels for the output
image. Single channel. Default: 1.
Returns:
PIL.Image or np.array: Grayscale version of the image.
if num_output_channels = 1 : returned image is single channel
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册