Skip to content
Snippets Groups Projects
Commit caeabcf6 authored by Daniel CARRON's avatar Daniel CARRON :b:
Browse files

[doc] More changes on transforms docstrings

parent 791e4152
No related branches found
No related tags found
1 merge request!15Update documentation
...@@ -13,8 +13,8 @@ def grayscale_to_rgb(img: torch.Tensor) -> torch.Tensor: ...@@ -13,8 +13,8 @@ def grayscale_to_rgb(img: torch.Tensor) -> torch.Tensor:
If the image is already in RGB format, then this is a NOOP - the same If the image is already in RGB format, then this is a NOOP - the same
tensor is returned (no cloning). If the image is in grayscale format tensor is returned (no cloning). If the image is in grayscale format
(number of channels = 1), then triplicate that channel 3 times (a new copy is (number of color channels = 1), then replicate it to obtain 3 color channels
returned in this case). (a new copy is returned in this case).
Parameters Parameters
...@@ -28,7 +28,7 @@ def grayscale_to_rgb(img: torch.Tensor) -> torch.Tensor: ...@@ -28,7 +28,7 @@ def grayscale_to_rgb(img: torch.Tensor) -> torch.Tensor:
------- -------
img img
Transformed tensor with the channel dimension replicated 3 times. Transformed tensor with 3 identical color channels.
""" """
if img.ndim < 3: if img.ndim < 3:
raise TypeError( raise TypeError(
...@@ -56,9 +56,9 @@ def rgb_to_grayscale(img: torch.Tensor) -> torch.Tensor: ...@@ -56,9 +56,9 @@ def rgb_to_grayscale(img: torch.Tensor) -> torch.Tensor:
"""Converts an image in RGB to grayscale. """Converts an image in RGB to grayscale.
If the image is already in grayscale format, then this is a NOOP - the same If the image is already in grayscale format, then this is a NOOP - the same
tensor is returned (no cloning). If the image is in RGB format, then tensor is returned (no cloning). If the image is in RGB format
compresses the color channels into a single grayscale channel (number of color channels = 3), then compresses the color channels into
following this equation: a single grayscale channel following this equation:
.. math:: .. math::
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment