Skip to content

Commit

Permalink
Improving RayBundle docstrings
Browse files Browse the repository at this point in the history
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
  • Loading branch information
shapovalov authored and facebook-github-bot committed Jul 23, 2021
1 parent 1872e02 commit e794d06
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pytorch3d/renderer/implicit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class RayBundle(NamedTuple):
RayBundle parametrizes points along projection rays by storing ray `origins`,
`directions` vectors and `lengths` at which the ray-points are sampled.
Furthermore, the xy-locations (`xys`) of the ray pixels are stored as well.
Note that `directions` don't have to be normalized; they define unit vectors
in the respective 1D coordinate systems; see documentation for
:func:`ray_bundle_to_ray_points` for the conversion formula.
"""

origins: torch.Tensor
Expand All @@ -36,6 +39,8 @@ def ray_bundle_to_ray_points(ray_bundle: RayBundle) -> torch.Tensor:
+ ray_bundle.directions[i, :] * ray_bundle.lengths[i, j]
)
```
Note that both the directions and magnitudes of the vectors in
`ray_bundle.directions` matter.
Args:
ray_bundle: A `RayBundle` object with fields:
Expand Down Expand Up @@ -70,6 +75,8 @@ def ray_bundle_variables_to_ray_points(
+ rays_directions[i, :] * rays_lengths[i, j]
)
```
Note that both the directions and magnitudes of the vectors in
`rays_directions` matter.
Args:
rays_origins: A tensor of shape `(..., 3)`
Expand Down

0 comments on commit e794d06

Please sign in to comment.