π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
fixing doctest in pinhole (#1743)
Edgar Riba5106d026230c
diff --git a/kornia/geometry/camera/pinhole.py b/kornia/geometry/camera/pinhole.pyindex 6f312144b..87c09ee3c 100644--- a/kornia/geometry/camera/pinhole.py+++ b/kornia/geometry/camera/pinhole.py@@ -281,12 +281,12 @@ class PinholeCamera:Example:>>> _ = torch.manual_seed(0)>>> X = torch.rand(1, 3)- >>> I = torch.eye(4)[None]+ >>> K = torch.eye(4)[None]>>> E = torch.eye(4)[None]>>> h = torch.ones(1)>>> w = torch.ones(1)>>> pinhole = kornia.geometry.camera.PinholeCamera(K, E, h, w)- >>> pinhole.project_points(X)+ >>> pinhole.project(X)tensor([[5.6088, 8.6827]])"""P = self.intrinsics @ self.extrinsics@@ -313,12 +313,12 @@ class PinholeCamera:>>> _ = torch.manual_seed(0)>>> x = torch.rand(1, 2)>>> depth = torch.ones(1, 1)- >>> I = torch.eye(4)[None]+ >>> K = torch.eye(4)[None]>>> E = torch.eye(4)[None]>>> h = torch.ones(1)>>> w = torch.ones(1)>>> pinhole = kornia.geometry.camera.PinholeCamera(K, E, h, w)- >>> pinhole.unproject_points(x, depth)+ >>> pinhole.unproject(x, depth)tensor([[0.4963, 0.7682, 1.0000]])"""P = self.intrinsics @ self.extrinsics