Skip to content
Snippets Groups Projects

Update documentation

Merged Daniel CARRON requested to merge update-doc into main
1 file
+ 6
6
Compare changes
  • Side-by-side
  • Inline
@@ -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::
Loading