mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-02 20:02:49 +08:00
raysampling stratified_sampling doc
Summary: Followup to D39259775 (438c194ec6
)
Reviewed By: davnov134
Differential Revision: D39271753
fbshipit-source-id: 5cf11c1210369e1762ef0d5d0c7b60336711b261
This commit is contained in:
parent
73ea4187de
commit
df36223ddf
@ -89,7 +89,7 @@ class MultinomialRaysampler(torch.nn.Module):
|
|||||||
max_depth: The maximum depth of a ray-point.
|
max_depth: The maximum depth of a ray-point.
|
||||||
n_rays_per_image: If given, this amount of rays are sampled from the grid.
|
n_rays_per_image: If given, this amount of rays are sampled from the grid.
|
||||||
unit_directions: whether to normalize direction vectors in ray bundle.
|
unit_directions: whether to normalize direction vectors in ray bundle.
|
||||||
stratified_sampling: if set, performs stratified random sampling
|
stratified_sampling: if True, performs stratified random sampling
|
||||||
along the ray; otherwise takes ray points at deterministic offsets.
|
along the ray; otherwise takes ray points at deterministic offsets.
|
||||||
"""
|
"""
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@ -136,9 +136,8 @@ class MultinomialRaysampler(torch.nn.Module):
|
|||||||
max_depth: The maximum depth of a ray-point.
|
max_depth: The maximum depth of a ray-point.
|
||||||
n_rays_per_image: If given, this amount of rays are sampled from the grid.
|
n_rays_per_image: If given, this amount of rays are sampled from the grid.
|
||||||
n_pts_per_ray: The number of points sampled along each ray.
|
n_pts_per_ray: The number of points sampled along each ray.
|
||||||
stratified_sampling: if set, performs stratified sampling in n_pts_per_ray
|
stratified_sampling: if set, overrides stratified_sampling provided
|
||||||
bins for each ray; otherwise takes n_pts_per_ray deterministic points
|
in __init__.
|
||||||
on each ray with uniform offsets.
|
|
||||||
Returns:
|
Returns:
|
||||||
A named tuple RayBundle with the following fields:
|
A named tuple RayBundle with the following fields:
|
||||||
origins: A tensor of shape
|
origins: A tensor of shape
|
||||||
@ -296,7 +295,7 @@ class MonteCarloRaysampler(torch.nn.Module):
|
|||||||
min_depth: The minimum depth of each ray-point.
|
min_depth: The minimum depth of each ray-point.
|
||||||
max_depth: The maximum depth of each ray-point.
|
max_depth: The maximum depth of each ray-point.
|
||||||
unit_directions: whether to normalize direction vectors in ray bundle.
|
unit_directions: whether to normalize direction vectors in ray bundle.
|
||||||
stratified_sampling: if set, performs stratified sampling in n_pts_per_ray
|
stratified_sampling: if True, performs stratified sampling in n_pts_per_ray
|
||||||
bins for each ray; otherwise takes n_pts_per_ray deterministic points
|
bins for each ray; otherwise takes n_pts_per_ray deterministic points
|
||||||
on each ray with uniform offsets.
|
on each ray with uniform offsets.
|
||||||
"""
|
"""
|
||||||
@ -322,9 +321,9 @@ class MonteCarloRaysampler(torch.nn.Module):
|
|||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
cameras: A batch of `batch_size` cameras from which the rays are emitted.
|
cameras: A batch of `batch_size` cameras from which the rays are emitted.
|
||||||
stratified_sampling: if set, performs stratified sampling in n_pts_per_ray
|
stratified_sampling: if set, overrides stratified_sampling provided
|
||||||
bins for each ray; otherwise takes n_pts_per_ray deterministic points
|
in __init__.
|
||||||
on each ray with uniform offsets.
|
|
||||||
Returns:
|
Returns:
|
||||||
A named tuple RayBundle with the following fields:
|
A named tuple RayBundle with the following fields:
|
||||||
origins: A tensor of shape
|
origins: A tensor of shape
|
||||||
@ -514,7 +513,7 @@ def _xy_to_ray_bundle(
|
|||||||
max_depth: The maximum depth of each ray-point.
|
max_depth: The maximum depth of each ray-point.
|
||||||
n_pts_per_ray: The number of points sampled along each ray.
|
n_pts_per_ray: The number of points sampled along each ray.
|
||||||
unit_directions: whether to normalize direction vectors in ray bundle.
|
unit_directions: whether to normalize direction vectors in ray bundle.
|
||||||
stratified_sampling: if set, performs stratified sampling in n_pts_per_ray
|
stratified_sampling: if True, performs stratified sampling in n_pts_per_ray
|
||||||
bins for each ray; otherwise takes n_pts_per_ray deterministic points
|
bins for each ray; otherwise takes n_pts_per_ray deterministic points
|
||||||
on each ray with uniform offsets.
|
on each ray with uniform offsets.
|
||||||
"""
|
"""
|
||||||
@ -583,7 +582,7 @@ def _jiggle_within_stratas(bin_centers: torch.Tensor) -> torch.Tensor:
|
|||||||
|
|
||||||
More specifically, it replaces each point's value `z`
|
More specifically, it replaces each point's value `z`
|
||||||
with a sample from a uniform random distribution on
|
with a sample from a uniform random distribution on
|
||||||
`[z - delta_−, z + delta_+]`, where `delta_−` is half of the difference
|
`[z - delta_-, z + delta_+]`, where `delta_-` is half of the difference
|
||||||
between `z` and the previous point, and `delta_+` is half of the difference
|
between `z` and the previous point, and `delta_+` is half of the difference
|
||||||
between the next point and `z`. For the first and last items, the
|
between the next point and `z`. For the first and last items, the
|
||||||
corresponding boundary deltas are assumed zero.
|
corresponding boundary deltas are assumed zero.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user