π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
reorganize sphinx image module
edgarriba3ca50c63e897
diff --git a/docs/source/color.rst b/docs/source/color.rstnew file mode 100644index 000000000..030f066bc--- /dev/null+++ b/docs/source/color.rst@@ -0,0 +1,9 @@+Image Color Space Conversions+-----------------------------++.. currentmodule:: torchgeometry.image++The functions in this section perform various color space conversions.++.. autoclass:: RgbToGrayscale+.. autofunction:: rgb_to_grayscalediff --git a/docs/source/filtering.rst b/docs/source/filtering.rstnew file mode 100644index 000000000..e2563715e--- /dev/null+++ b/docs/source/filtering.rst@@ -0,0 +1,12 @@+Image Filtering+---------------++.. currentmodule:: torchgeometry.image++The functions in this sections perform various image filtering operations.++.. autofunction:: get_gaussian_kernel+.. autofunction:: get_gaussian_kernel2d+.. autofunction:: gaussian_blur++.. autoclass:: GaussianBlurdiff --git a/docs/source/image.rst b/docs/source/image.rstindex bf1243723..c93c0a5aa 100644--- a/docs/source/image.rst+++ b/docs/source/image.rst@@ -1,12 +1,8 @@torchgeometry.image===================-.. currentmodule:: torchgeometry.image+.. toctree::+ :maxdepth: 2-.. autofunction:: get_gaussian_kernel-.. autofunction:: get_gaussian_kernel2d-.. autofunction:: gaussian_blur-.. autofunction:: rgb_to_grayscale--.. autoclass:: GaussianBlur-.. autoclass:: RgbToGrayscale+ filtering+ colordiff --git a/torchgeometry/image/color.py b/torchgeometry/image/color.pyindex d200ffa61..b5c458fd7 100644--- a/torchgeometry/image/color.py+++ b/torchgeometry/image/color.py@@ -5,6 +5,8 @@ import torch.nn as nnclass RgbToGrayscale(nn.Module):r"""Convert image to grayscale version of image.+ The image data is assumed to be in the range of (0, 1).+Args:input (torch.Tensor): Image to be converted to grayscale.diff --git a/torchgeometry/image/gaussian.py b/torchgeometry/image/gaussian.pyindex 3f792dcad..21652efb0 100644--- a/torchgeometry/image/gaussian.py+++ b/torchgeometry/image/gaussian.py@@ -24,7 +24,7 @@ def get_gaussian_kernel(kernel_size: int, sigma: float) -> torch.Tensor:Tensor: 1D tensor with gaussian filter coefficients.Shape:- - Output: :math:`(kernel_size)`+ - Output: :math:`(\text{kernel_size})`Examples::@@ -35,9 +35,9 @@ def get_gaussian_kernel(kernel_size: int, sigma: float) -> torch.Tensor:tensor([0.1201, 0.2339, 0.2921, 0.2339, 0.1201])"""if not isinstance(kernel_size, int) or kernel_size % 2 == 0 or \- kernel_size <= 0:- raise TypeError("kernel_size must be an odd positive integer. "- "Got {}".format(ksize))+ kernel_size <= 0:+ raise TypeError("kernel_size must be an odd positive integer. "+ "Got {}".format(kernel_size))window_1d: torch.Tensor = gaussian(kernel_size, sigma)return window_1d@@ -72,7 +72,7 @@ def get_gaussian_kernel2d(kernel_size: Tuple[int, int],"""if not isinstance(kernel_size, tuple) or len(kernel_size) != 2:raise TypeError("kernel_size must be a tuple of length two. Got {}"- .format(ksize))+ .format(kernel_size))if not isinstance(sigma, tuple) or len(sigma) != 2:raise TypeError("sigma must be a tuple of length two. Got {}".format(sigma))