Skip to content

Commit e794d06

Browse files
shapovalovfacebook-github-bot
authored andcommitted
Improving RayBundle docstrings
Summary: This changes only documentation. We want to be explicit that ray directions are not normalised (nor assumed to be normalised) but their magnitude is used. Reviewed By: nikhilaravi Differential Revision: D29845210 fbshipit-source-id: b81fb3da13a42ad20e8721ed5271fd4f3d8f5acb
1 parent 1872e02 commit e794d06

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pytorch3d/renderer/implicit/utils.py

+7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ class RayBundle(NamedTuple):
1414
RayBundle parametrizes points along projection rays by storing ray `origins`,
1515
`directions` vectors and `lengths` at which the ray-points are sampled.
1616
Furthermore, the xy-locations (`xys`) of the ray pixels are stored as well.
17+
Note that `directions` don't have to be normalized; they define unit vectors
18+
in the respective 1D coordinate systems; see documentation for
19+
:func:`ray_bundle_to_ray_points` for the conversion formula.
1720
"""
1821

1922
origins: torch.Tensor
@@ -36,6 +39,8 @@ def ray_bundle_to_ray_points(ray_bundle: RayBundle) -> torch.Tensor:
3639
+ ray_bundle.directions[i, :] * ray_bundle.lengths[i, j]
3740
)
3841
```
42+
Note that both the directions and magnitudes of the vectors in
43+
`ray_bundle.directions` matter.
3944
4045
Args:
4146
ray_bundle: A `RayBundle` object with fields:
@@ -70,6 +75,8 @@ def ray_bundle_variables_to_ray_points(
7075
+ rays_directions[i, :] * rays_lengths[i, j]
7176
)
7277
```
78+
Note that both the directions and magnitudes of the vectors in
79+
`rays_directions` matter.
7380
7481
Args:
7582
rays_origins: A tensor of shape `(..., 3)`

0 commit comments

Comments
 (0)