Shortcuts

mmagic.models.editors.eg3d.ray_sampler

Module Contents

Functions

sample_rays(→ Tuple[torch.Tensor])

Sample origin and direction vectors of rays with passed camera-to-world

mmagic.models.editors.eg3d.ray_sampler.sample_rays(cam2world: torch.Tensor, intrinsics: torch.Tensor, resolution: int) Tuple[torch.Tensor][source]

Sample origin and direction vectors of rays with passed camera-to-world matrix and intrinsics matrix. Noted that skew coefficient is not considered in this function.

Parameters
  • cam2world (torch.Tensor) – The camera-to-world matrix in homogeneous coordinates. Shape like (bz, 4, 4).

  • intrinsics (torch.Tensor) – The intrinsic matrix. Shape like (bz, 3, 3).

  • resolution (int) – The expect resolution of the render output.

Returns

Origins and view directions for rays. Both shape

like (bz, resolution^2, 3)

Return type

Tuple[torch.Tensor]

Read the Docs v: latest
Versions
latest
stable
0.x
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.