Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

Fix typo in color files

HassanAlsamahi5c99b5c5f4d5
diff --git a/kornia/color/gray.py b/kornia/color/gray.py
index 5667bca41..810f9e7a2 100644
--- a/kornia/color/gray.py
+++ b/kornia/color/gray.py
@@ -8,7 +8,7 @@ class RgbToGrayscale(nn.Module):
the image data is assumed to be in the range of (0, 1).
args:
- input (torch.Tensor): image to be converted to grayscale.
+ input (torch.Tensor): RGB image to be converted to grayscale.
returns:
torch.Tensor: grayscale version of the image.
@@ -37,7 +37,7 @@ def rgb_to_grayscale(input: torch.Tensor) -> torch.Tensor:
See :class:`~kornia.color.RgbToGrayscale` for details.
Args:
- input (torch.Tensor): Image to be converted to grayscale.
+ input (torch.Tensor): RGB image to be converted to grayscale.
Returns:
torch.Tensor: Grayscale version of the image.
diff --git a/kornia/color/hsv.py b/kornia/color/hsv.py
index 0c8aaa6e9..9b35ad42e 100644
--- a/kornia/color/hsv.py
+++ b/kornia/color/hsv.py
@@ -7,15 +7,21 @@ class HsvToRgb(nn.Module):
The image data is assumed to be in the range of (0, 1).
args:
- image (torch.Tensor): RGB image to be converted to HSV.
+ image (torch.Tensor): HSV image to be converted to RGB.
returns:
- torch.tensor: HSV version of the image.
+ torch.tensor: RGB version of the image.
shape:
- image: :math:`(*, 3, H, W)`
- output: :math:`(*, 3, H, W)`
+ Examples::
+
+ >>> input = torch.rand(2, 3, 4, 5)
+ >>> rgb = kornia.image.HsvToRgb()
+ >>> output = rgb(input) # 2x3x4x5
+
"""
def __init__(self) -> None:
@@ -30,11 +36,11 @@ def hsv_to_rgb(image):
The image data is assumed to be in the range of (0, 1).
Args:
- input (torch.Tensor): RGB Image to be converted to HSV.
+ input (torch.Tensor): HSV Image to be converted to RGB.
Returns:
- torch.Tensor: HSV version of the image.
+ torch.Tensor: RGB version of the image.
"""
if not torch.is_tensor(image):
@@ -82,6 +88,12 @@ class RgbToHsv(nn.Module):
- image: :math:`(*, 3, H, W)`
- output: :math:`(*, 3, H, W)`
+ Examples::
+
+ >>> input = torch.rand(2, 3, 4, 5)
+ >>> hsv = kornia.image.RgbToHsv()
+ >>> output = hsv(input) # 2x3x4x5
+
"""
def __init__(self) -> None:
diff --git a/kornia/color/rgb.py b/kornia/color/rgb.py
index cd9903a0f..2d5402638 100644
--- a/kornia/color/rgb.py
+++ b/kornia/color/rgb.py
@@ -17,6 +17,12 @@ class RgbToBgr(nn.Module):
- image: :math:`(*, 3, H, W)`
- output: :math:`(*, 3, H, W)`
+ Examples::
+
+ >>> input = torch.rand(2, 3, 4, 5)
+ >>> bgr = kornia.image.RgbToBgr()
+ >>> output = bgr(input) # 2x3x4x5
+
"""
def __init__(self) -> None:
@@ -56,6 +62,12 @@ class BgrToRgb(nn.Module):
- image: :math:`(*, 3, H, W)`
- output: :math:`(*, 3, H, W)`
+ Examples::
+
+ >>> input = torch.rand(2, 3, 4, 5)
+ >>> rgb = kornia.image.BgrToRgb()
+ >>> output = rgb(input) # 2x3x4x5
+
"""
def __init__(self) -> None: