π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
fix docs
edgarriba5b7ddbb81625
diff --git a/torchgeometry/conversions.py b/torchgeometry/conversions.pyindex 110070c64..cd79ba538 100644--- a/torchgeometry/conversions.py+++ b/torchgeometry/conversions.py@@ -602,4 +602,3 @@ class RtvecToPose(nn.Module):def forward(self, input):return rtvec_to_pose(input)->>>>>>> refactor and add layers apidiff --git a/torchgeometry/depth_warper.py b/torchgeometry/depth_warper.pyindex 34c9e981f..c56753207 100644--- a/torchgeometry/depth_warper.py+++ b/torchgeometry/depth_warper.py@@ -24,16 +24,6 @@ class DepthWarper(nn.Module):width (int): The width of the image to warp. Optional.height (int): The height of the image to warp. Optional.- .. note::- The pinhole model is represented in a single vector as follows:-- .. math::- pinhole = (f_x, f_y, c_x, c_y, height, width, r_x, r_y, r_z, t_x, t_y, t_z)-- where:- :math:`(r_x, r_y, r_z)` is the rotation vector in angle-axis convention.-- :math:`(t_x, t_y, t_z)` is the translation vector."""def __init__(self, pinholes, width=None, height=None):super(DepthWarper, self).__init__()@@ -172,7 +162,7 @@ def depth_warp(pinholes_i, pinhole_ref, inv_depth_ref, patch_i, \width=None, height=None):""".. note::- Functional API for :class:`torgeometry.DepthWarper`.+ Functional API for :class:`torgeometry.DepthWarper`Warps a patch by inverse depth.diff --git a/torchgeometry/homography_warper.py b/torchgeometry/homography_warper.pyindex f5000bdab..dab15398a 100644--- a/torchgeometry/homography_warper.py+++ b/torchgeometry/homography_warper.py@@ -135,7 +135,8 @@ class HomographyWarper(nn.Module):def homography_warp(patch, dst_H_src, dsize, points=None,padding_mode='zeros'):- """Functional API for :class:`torgeometry.HomographyWarper`.+ """+ .. note:: Functional API for :class:`torgeometry.HomographyWarper`Warps patches by homographies.diff --git a/torchgeometry/pinhole.py b/torchgeometry/pinhole.pyindex 4c94fda5e..08279f0da 100644--- a/torchgeometry/pinhole.py+++ b/torchgeometry/pinhole.py@@ -74,7 +74,7 @@ def pinhole_matrix(pinholes):return k-def inv_pinhole_matrix(pinhole, eps=1e-6):+def inverse_pinhole_matrix(pinhole, eps=1e-6):"""Invert a set of pinholesArgs:diff --git a/torchgeometry/utils.py b/torchgeometry/utils.pyindex 3aa21c56b..16d8632de 100644--- a/torchgeometry/utils.py+++ b/torchgeometry/utils.py@@ -10,22 +10,28 @@ __all__ = ["tensor_to_image","image_to_tensor","draw_rectangle",- "create_pinhole"+ "create_pinhole","inverse","Inverse",]-def inverse(homography):- # TODO: add documentation- # NOTE: we expect in the future to have a native Pytorch function- """Batched version of torch.inverse(...)+def inverse(transforms):+ """Batched version of `torch.inverse`++ Args:+ transforms (Tensor): tensor of transformations of size (B, D, D).++ Returns:+ Tensor: tensor of inverted transformations of size (B, D, D).+"""- if not len(homography.shape) == 3:- raise ValueError("Input size must be a three dimensional tensor. Got {}"- .format(homography.shape))+ if not len(transforms.shape) == 3:+ raise ValueError(+ "Input size must be a three dimensional tensor. Got {}".format(+ transforms.shape))# iterate, compute inverse and stack tensors- return torch.stack([torch.inverse(homo) for homo in homography])+ return torch.stack([torch.inverse(transform) for transform in transforms])class Inverse(nn.Module):@@ -58,8 +64,7 @@ def image_to_tensor(image):def tensor_to_image(tensor):- """Converts a torch.Tensor image to a numpy image. In case the tensor is- in the GPU, it will be copied back to CPU.+ """Converts a torch.Tensor image to a numpy image. In case the tensor is in the GPU, it will be copied back to CPU.Args:tensor (Tensor): image of the form (C, H, W).