nerfacc.ray_resampling¶
- nerfacc.ray_resampling(packed_info, t_starts, t_ends, weights, n_samples)¶
Resample a set of rays based on the CDF of the weights.
- Parameters:
packed_info (Tensor) – Stores information on which samples belong to the same ray. See
nerfacc.ray_marching()for details. Tensor with shape (n_rays, 2).t_starts (Tensor) – Where the frustum-shape sample starts along a ray. Tensor with shape (n_samples, 1).
t_ends (Tensor) – Where the frustum-shape sample ends along a ray. Tensor with shape (n_samples, 1).
weights (Tensor) – Volumetric rendering weights for those samples. Tensor with shape (n_samples,).
n_samples (int) – Number of samples per ray to resample.
- Returns:
Resampled packed info (n_rays, 2), t_starts (n_samples, 1), and t_ends (n_samples, 1).
- Return type:
Tuple[Tensor, Tensor, Tensor]