π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
Suppress doc warnings.
Jian S6b0bd588f2e6
diff --git a/docs/source/augmentation.functional.rst b/docs/source/augmentation.functional.rstindex 2eda795b8..9c1fc74f3 100644--- a/docs/source/augmentation.functional.rst+++ b/docs/source/augmentation.functional.rst@@ -1,5 +1,5 @@kornia.augmentation-------------+-------------------.. currentmodule:: kornia.augmentation.functionaldiff --git a/docs/source/augmentation.param_gen.rst b/docs/source/augmentation.param_gen.rstindex 4f3401b17..45b042985 100644--- a/docs/source/augmentation.param_gen.rst+++ b/docs/source/augmentation.param_gen.rst@@ -1,5 +1,5 @@kornia.augmentation-------------+-------------------.. currentmodule:: kornia.augmentation.param_gendiff --git a/docs/source/augmentation.rst b/docs/source/augmentation.rstindex 5a5b33ea1..eb96f9955 100644--- a/docs/source/augmentation.rst+++ b/docs/source/augmentation.rst@@ -1,5 +1,5 @@kornia.augmentation-------------+-------------------.. currentmodule:: kornia.augmentationdiff --git a/docs/source/index.rst b/docs/source/index.rstindex 406e04150..d73cd0d3d 100644--- a/docs/source/index.rst+++ b/docs/source/index.rst@@ -18,6 +18,8 @@ Kornia Documentation:caption: Package Referenceaugmentation+ augmentation.functional+ augmentation.param_gencolorcontribfeaturediff --git a/kornia/augmentation/functional.py b/kornia/augmentation/functional.pyindex 088719f98..4dca901a5 100644--- a/kornia/augmentation/functional.py+++ b/kornia/augmentation/functional.py@@ -7,6 +7,7 @@ import kornia.augmentation.param_gen as pgfrom kornia.geometry.transform.flips import hflip, vflipfrom kornia.color.adjust import AdjustBrightness, AdjustContrast, AdjustSaturation, AdjustHuefrom kornia.color.gray import rgb_to_grayscale+from kornia.augmentation.random_erasing import random_rectangle_eraseUnionType = Union[torch.Tensor, Tuple[torch.Tensor, torch.Tensor]]@@ -14,10 +15,10 @@ FloatUnionType = Union[torch.Tensor, float, Tuple[float, float], List[float]]def random_hflip(input: torch.Tensor, p: float = 0.5, return_transform: bool = False) -> UnionType:- """Generate params and apply operation on input tensor.+ r"""Generate params and apply operation on input tensor.- See :function:`~kornia.augmentation.param_gen._random_prob_gen` for details.- See :function:`~kornia.augmentation.functional.apply_hflip` for details.+ See :func:`~kornia.augmentation.param_gen._random_prob_gen` for details.+ See :func:`~kornia.augmentation.functional.apply_hflip` for details."""if isinstance(input, tuple):batch_size = input[0].shape[0] if len(input[0].shape) == 4 else 1@@ -28,10 +29,10 @@ def random_hflip(input: torch.Tensor, p: float = 0.5, return_transform: bool = Fdef random_vflip(input: torch.Tensor, p: float = 0.5, return_transform: bool = False) -> UnionType:- """Generate params and apply operation on input tensor.+ r"""Generate params and apply operation on input tensor.- See :function:`~kornia.augmentation.param_gen._random_prob_gen` for details.- See :function:`~kornia.augmentation.functional.apply_vflip` for details.+ See :func:`~kornia.augmentation.param_gen._random_prob_gen` for details.+ See :func:`~kornia.augmentation.functional.apply_vflip` for details."""if isinstance(input, tuple):batch_size = input[0].shape[0] if len(input[0].shape) == 4 else 1@@ -44,10 +45,10 @@ def random_vflip(input: torch.Tensor, p: float = 0.5, return_transform: bool = Fdef color_jitter(input: torch.Tensor, brightness: FloatUnionType = 0.,contrast: FloatUnionType = 0., saturation: FloatUnionType = 0.,hue: FloatUnionType = 0., return_transform: bool = False) -> UnionType:- """Generate params and apply operation on input tensor.+ r"""Generate params and apply operation on input tensor.- See :function:`~kornia.augmentation.param_gen._random_color_jitter_gen` for details.- See :function:`~kornia.augmentation.functional.apply_color_jitter` for details.+ See :func:`~kornia.augmentation.param_gen._random_color_jitter_gen` for details.+ See :func:`~kornia.augmentation.functional.apply_color_jitter` for details."""if isinstance(input, tuple):batch_size = input[0].shape[0] if len(input[0].shape) == 4 else 1@@ -58,10 +59,10 @@ def color_jitter(input: torch.Tensor, brightness: FloatUnionType = 0.,def random_grayscale(input: torch.Tensor, p: float = 0.5, return_transform: bool = False):- """Generate params and apply operation on input tensor.+ r"""Generate params and apply operation on input tensor.- See :function:`~kornia.augmentation.param_gen._random_prob_gen` for details.- See :function:`~kornia.augmentation.functional.apply_grayscale` for details.+ See :func:`~kornia.augmentation.param_gen._random_prob_gen` for details.+ See :func:`~kornia.augmentation.functional.apply_grayscale` for details."""if isinstance(input, tuple):batch_size = input[0].shape[0] if len(input[0].shape) == 4 else 1@@ -84,7 +85,7 @@ def apply_hflip(input: torch.Tensor, params: Dict[str, torch.Tensor], return_traReturns:torch.Tensor: The horizontally flipped inputtorch.Tensor: The applied transformation matrix :math: `(*, 3, 3)` if return_transform flag- is set to ``True``+ is set to ``True``"""if not torch.is_tensor(input):@@ -143,7 +144,7 @@ def apply_vflip(input: torch.Tensor, params: Dict[str, torch.Tensor], return_traReturns:torch.Tensor: The vertically flipped inputtorch.Tensor: The applied transformation matrix :math: `(*, 3, 3)` if return_transform flag- is set to ``True``+ is set to ``True``"""# TODO: params validation@@ -187,7 +188,7 @@ def apply_vflip(input: torch.Tensor, params: Dict[str, torch.Tensor], return_tradef apply_color_jitter(input: torch.Tensor, params: Dict[str, torch.Tensor],return_transform: bool = False) -> UnionType:- """Apply Color Jitter on a tensor image or a batch of tensor images with given random parameters.+ r"""Apply Color Jitter on a tensor image or a batch of tensor images with given random parameters.Input should be a tensor of shape (H, W), (C, H, W) or a batch of tensors :math:`(*, C, H, W)`.Args:@@ -203,7 +204,7 @@ def apply_color_jitter(input: torch.Tensor, params: Dict[str, torch.Tensor],Returns:torch.Tensor: The color jitterred inputtorch.Tensor: The applied transformation matrix :math: `(*, 3, 3)` if return_transform flag- is set to ``True``+ is set to ``True``"""# TODO: params validation@@ -246,7 +247,7 @@ def apply_color_jitter(input: torch.Tensor, params: Dict[str, torch.Tensor],def apply_grayscale(input: torch.Tensor, params: Dict[str, torch.Tensor], return_transform: bool = False) -> UnionType:- """Apply Gray Scale on a tensor image or a batch of tensor images with given random parameters.+ r"""Apply Gray Scale on a tensor image or a batch of tensor images with given random parameters.Input should be a tensor of shape (3, H, W) or a batch of tensors :math:`(*, 3, H, W)`.Args:@@ -258,7 +259,7 @@ def apply_grayscale(input: torch.Tensor, params: Dict[str, torch.Tensor], returnReturns:torch.Tensor: The grayscaled inputtorch.Tensor: The applied transformation matrix :math: `(*, 3, 3)` if return_transform flag- is set to ``True``+ is set to ``True``"""# TODO: params validation