mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-23 07:40:34 +08:00
avoid deprecated raysamplers
Summary: Migrate away from NDCGridRaysampler and GridRaysampler to their more flexible replacements. Reviewed By: patricklabatut Differential Revision: D33281584 fbshipit-source-id: 65f8702e700a32d38f7cd6bda3924bb1707a0633
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3eb4233844
commit
67778caee8
@@ -100,7 +100,7 @@
|
||||
"from pytorch3d.transforms import so3_exp_map\n",
|
||||
"from pytorch3d.renderer import (\n",
|
||||
" FoVPerspectiveCameras, \n",
|
||||
" NDCGridRaysampler,\n",
|
||||
" NDCMultinomialRaysampler,\n",
|
||||
" MonteCarloRaysampler,\n",
|
||||
" EmissionAbsorptionRaymarcher,\n",
|
||||
" ImplicitRenderer,\n",
|
||||
@@ -186,7 +186,7 @@
|
||||
"The renderer is composed of a *raymarcher* and a *raysampler*.\n",
|
||||
"- The *raysampler* is responsible for emitting rays from image pixels and sampling the points along them. Here, we use two different raysamplers:\n",
|
||||
" - `MonteCarloRaysampler` is used to generate rays from a random subset of pixels of the image plane. The random subsampling of pixels is carried out during **training** to decrease the memory consumption of the implicit model.\n",
|
||||
" - `NDCGridRaysampler` which follows the standard PyTorch3D coordinate grid convention (+X from right to left; +Y from bottom to top; +Z away from the user). In combination with the implicit model of the scene, `NDCGridRaysampler` consumes a large amount of memory and, hence, is only used for visualizing the results of the training at **test** time.\n",
|
||||
" - `NDCMultinomialRaysampler` which follows the standard PyTorch3D coordinate grid convention (+X from right to left; +Y from bottom to top; +Z away from the user). In combination with the implicit model of the scene, `NDCMultinomialRaysampler` consumes a large amount of memory and, hence, is only used for visualizing the results of the training at **test** time.\n",
|
||||
"- The *raymarcher* takes the densities and colors sampled along each ray and renders each ray into a color and an opacity value of the ray's source pixel. Here we use the `EmissionAbsorptionRaymarcher` which implements the standard Emission-Absorption raymarching algorithm."
|
||||
]
|
||||
},
|
||||
@@ -211,10 +211,10 @@
|
||||
"\n",
|
||||
"# 1) Instantiate the raysamplers.\n",
|
||||
"\n",
|
||||
"# Here, NDCGridRaysampler generates a rectangular image\n",
|
||||
"# Here, NDCMultinomialRaysampler generates a rectangular image\n",
|
||||
"# grid of rays whose coordinates follow the PyTorch3D\n",
|
||||
"# coordinate conventions.\n",
|
||||
"raysampler_grid = NDCGridRaysampler(\n",
|
||||
"raysampler_grid = NDCMultinomialRaysampler(\n",
|
||||
" image_height=render_size,\n",
|
||||
" image_width=render_size,\n",
|
||||
" n_pts_per_ray=128,\n",
|
||||
@@ -844,7 +844,7 @@
|
||||
" fov=target_cameras.fov[0],\n",
|
||||
" device=device,\n",
|
||||
" )\n",
|
||||
" # Note that we again render with `NDCGridRaySampler`\n",
|
||||
" # Note that we again render with `NDCMultinomialRaysampler`\n",
|
||||
" # and the batched_forward function of neural_radiance_field.\n",
|
||||
" frames.append(\n",
|
||||
" renderer_grid(\n",
|
||||
@@ -867,7 +867,7 @@
|
||||
"source": [
|
||||
"## 6. Conclusion\n",
|
||||
"\n",
|
||||
"In this tutorial, we have shown how to optimize an implicit representation of a scene such that the renders of the scene from known viewpoints match the observed images for each viewpoint. The rendering was carried out using the PyTorch3D's implicit function renderer composed of either a `MonteCarloRaysampler` or `NDCGridRaysampler`, and an `EmissionAbsorptionRaymarcher`."
|
||||
"In this tutorial, we have shown how to optimize an implicit representation of a scene such that the renders of the scene from known viewpoints match the observed images for each viewpoint. The rendering was carried out using the PyTorch3D's implicit function renderer composed of either a `MonteCarloRaysampler` or `NDCMultinomialRaysampler`, and an `EmissionAbsorptionRaymarcher`."
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user