mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-04 06:49:13 +08:00
adding viewer video + other doc related updates (#688)
This commit is contained in:
1 parent
9cc50132c5
commit
917d02c695
13 files changed
+142
-50
No files matched your search
@@ -1,12 +1,12 @@
|
||||
# Model Components
|
||||
# Model components
|
||||
|
||||
It can be difficult getting started with NeRFs. The reserach field is still quite new and most of the key nuggets are burried in academic papers. For this reason, we have consoladated many of the key concepts into a series of guides.
|
||||
|
||||
```{toctree}
|
||||
:maxdepth: 1
|
||||
Cameras Models<visualize_cameras.ipynb>
|
||||
Sample Representation<visualize_samples.ipynb>
|
||||
Ray Samplers<visualize_samplers.ipynb>
|
||||
Spatial Distortions<visualize_spatial_distortions.ipynb>
|
||||
Cameras models<visualize_cameras.ipynb>
|
||||
Sample representation<visualize_samples.ipynb>
|
||||
Ray samplers<visualize_samplers.ipynb>
|
||||
Spatial distortions<visualize_spatial_distortions.ipynb>
|
||||
Encoders<visualize_encoders.ipynb>
|
||||
```
|
||||
@@ -8,9 +8,13 @@
|
||||
"\n",
|
||||
"## Overview\n",
|
||||
"\n",
|
||||
"Once we have a set of cameras, we want to cast camera rays associated with each pixel. Along these ray we will sample the _field_ and aggregate the samples to predict the pixels value (ie. color). The parameterization of the samples are described [here](./visualize_samples.ipynb) however we must decide where to place these samples along a ray. For this task we will use a [`Sampler`](../../reference/api/model_components/ray_sampler.rst).\n",
|
||||
"Once we have a set of cameras, we want to cast camera rays associated with each pixel. \n",
|
||||
"\n",
|
||||
"In the ideal world we would compute many dense samples along a ray. Unfortunatly each additional sample adds a computation cost to the system as it needs to be processed by the _field_ which is often a neural network. As a result it is common for NeRF methods to use on the order of 100 samples. Therefore we want to optimize where those samples are placed in the scene.\n",
|
||||
"Along these ray we will sample the _field_ and aggregate the samples to predict the pixels value (ie. color). The parameterization of the samples are described [here](./visualize_samples.ipynb) however we must decide where to place these samples along a ray. For this task we will use a [`Sampler`](../../reference/api/model_components/ray_sampler.rst).\n",
|
||||
"\n",
|
||||
"In the ideal world we would compute many dense samples along a ray. Unfortunatly each additional sample adds a computation cost to the system as it needs to be processed by the _field_ which is often a neural network. \n",
|
||||
"\n",
|
||||
"As a result it is common for NeRF methods to use on the order of 100 samples. Therefore we want to optimize where those samples are placed in the scene.\n",
|
||||
"\n",
|
||||
"For example, if the sene can be bounded by a box and the objects are all similar scales, uniform sampling along the ray may be a good option. On the other hand if the scene is unbounded (potential extending as far as the the eye can see) uniform sampling does not make sense as the samples would be very sparse for close objects. In this case a different sampling like _Uniform in Disparity_ may perform better.\n",
|
||||
"\n",
|
||||
@@ -26,7 +30,11 @@
|
||||
"\n",
|
||||
"### Stratified Sampling\n",
|
||||
"\n",
|
||||
"Most samplers has the option to _stratify_ the samplers. When stratified, each sample is randomly perturbed. The magnitude of the pertubation is such that the sample ordering remains consistent and the overal distribution statistics are not changed. Using stratified samples during training generally improves the reconstructions as it help prevent overfitting. During inference stratified sampling should be disabled (nerfstudio samplers will do this) as it can cause noisy artifacts when the camera moves.\n",
|
||||
"Most samplers has the option to _stratify_ the samplers. When stratified, each sample is randomly perturbed. \n",
|
||||
"\n",
|
||||
"The magnitude of the pertubation is such that the sample ordering remains consistent and the overal distribution statistics are not changed. Using stratified samples during training generally improves the reconstructions as it help prevent overfitting. \n",
|
||||
"\n",
|
||||
"During inference stratified sampling should be disabled (nerfstudio samplers will do this) as it can cause noisy artifacts when the camera moves.\n",
|
||||
"\n",
|
||||
"```{image} imgs/samplers_stratified-light.png\n",
|
||||
":align: center\n",
|
||||
@@ -40,7 +48,11 @@
|
||||
"\n",
|
||||
"### Heirarchical Sampling\n",
|
||||
"\n",
|
||||
"It is important to sample the scene where it has content otherwise the reconstruction quality will be reduced. One trick that is often employed in NeRF methods is to do multiple round of sampling. The first round can use a predefined sampler (ie. Uniform) to generate an image. Once the space is sampled, we have an idea which samples contributed to the final color. We can use this information to sample more around those regions using a `PDFSampler`. The PDF sampler is described more below."
|
||||
"It is important to sample the scene where it has content otherwise the reconstruction quality will be reduced. \n",
|
||||
"\n",
|
||||
"One trick that is often employed in NeRF methods is to do multiple round of sampling. The first round can use a predefined sampler (ie. Uniform) to generate an image. Once the space is sampled, we have an idea which samples contributed to the final color. \n",
|
||||
"\n",
|
||||
"We can use this information to sample more around those regions using a `PDFSampler`. The PDF sampler is described more below."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -5285,7 +5297,9 @@
|
||||
"source": [
|
||||
"## PDF Sampler\n",
|
||||
"\n",
|
||||
"The Probability Distribution Function (PDF) Sampler generates samples that match a given distribution. In the example below we first create a `UniformSampler` to generate a set of initial samples. We then assign weights to each of these samples to define the PDF (here it is an arbitrary funtion, but usually you would use the predicted weights from the field). The left plot the target PDF, on the right we plot a histogram of samples generated from the `PDFSampler`."
|
||||
"The Probability Distribution Function (PDF) Sampler generates samples that match a given distribution. \n",
|
||||
"\n",
|
||||
"In the example below we first create a `UniformSampler` to generate a set of initial samples. We then assign weights to each of these samples to define the PDF (here it is an arbitrary funtion, but usually you would use the predicted weights from the field). The left plot the target PDF, on the right we plot a histogram of samples generated from the `PDFSampler`."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user