mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-14 11:26:24 +08:00
spelling
Summary: Collection of spelling things, mostly in docs / tutorials. Reviewed By: gkioxari Differential Revision: D26101323 fbshipit-source-id: 652f62bc9d71a4ff872efa21141225e43191353a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c2e62a5087
commit
124bb5e391
@@ -50,7 +50,7 @@ python ./test_nerf.py --config-name lego
|
||||
```
|
||||
Will load a trained model from the `./checkpoints` directory and evaluate it on the test split of the corresponding dataset (Lego in the case above).
|
||||
|
||||
### Exporting multi-view video of the radience field
|
||||
### Exporting multi-view video of the radiance field
|
||||
Furthermore, the codebase supports generating videos of the neural radiance field.
|
||||
The following generates a turntable video of the Lego scene:
|
||||
```
|
||||
|
||||
@@ -77,7 +77,7 @@ def generate_eval_video_cameras(
|
||||
cam_centers_c = cam_centers - plane_mean[None]
|
||||
|
||||
if up is not None:
|
||||
# us the up vector instad of the plane through the camera centers
|
||||
# us the up vector instead of the plane through the camera centers
|
||||
plane_normal = torch.FloatTensor(up)
|
||||
else:
|
||||
cov = (cam_centers_c.t() @ cam_centers_c) / cam_centers_c.shape[0]
|
||||
@@ -99,7 +99,7 @@ def generate_eval_video_cameras(
|
||||
traj = traj @ e_vec.t() + plane_mean[None]
|
||||
|
||||
else:
|
||||
raise ValueError(f"Uknown trajectory_type {trajectory_type}.")
|
||||
raise ValueError(f"Unknown trajectory_type {trajectory_type}.")
|
||||
|
||||
# point all cameras towards the center of the scene
|
||||
R, T = look_at_view_transform(
|
||||
|
||||
@@ -42,7 +42,7 @@ class HarmonicEmbedding(torch.nn.Module):
|
||||
)`
|
||||
|
||||
Note that `x` is also premultiplied by the base frequency `omega0`
|
||||
before evaluting the harmonic functions.
|
||||
before evaluating the harmonic functions.
|
||||
"""
|
||||
super().__init__()
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ class NeuralRadianceField(torch.nn.Module):
|
||||
|
||||
Returns:
|
||||
rays_densities: A tensor of shape `(minibatch, ..., num_points_per_ray, 1)`
|
||||
denoting the opacitiy of each ray point.
|
||||
denoting the opacity of each ray point.
|
||||
rays_colors: A tensor of shape `(minibatch, ..., num_points_per_ray, 3)`
|
||||
denoting the color of each ray point.
|
||||
"""
|
||||
|
||||
@@ -266,7 +266,7 @@ class RadianceFieldRenderer(torch.nn.Module):
|
||||
image: torch.Tensor,
|
||||
) -> Tuple[dict, dict]:
|
||||
"""
|
||||
Performs the coarse and fine rendering passees of the radiance field
|
||||
Performs the coarse and fine rendering passes of the radiance field
|
||||
from the viewpoint of the input `camera`.
|
||||
Afterwards, both renders are compared to the input ground truth `image`
|
||||
by evaluating the peak signal-to-noise ratio and the mean-squared error.
|
||||
|
||||
@@ -36,7 +36,7 @@ class EmissionAbsorptionNeRFRaymarcher(EmissionAbsorptionRaymarcher):
|
||||
rays_features: Per-ray feature values represented with a tensor
|
||||
of shape `(..., n_points_per_ray, feature_dim)`.
|
||||
eps: A lower bound added to `rays_densities` before computing
|
||||
the absorbtion function (cumprod of `1-rays_densities` along
|
||||
the absorption function (cumprod of `1-rays_densities` along
|
||||
each ray). This prevents the cumprod to yield exact 0
|
||||
which would inhibit any gradient-based learning.
|
||||
|
||||
@@ -44,7 +44,7 @@ class EmissionAbsorptionNeRFRaymarcher(EmissionAbsorptionRaymarcher):
|
||||
features: A tensor of shape `(..., feature_dim)` containing
|
||||
the rendered features for each ray.
|
||||
weights: A tensor of shape `(..., n_points_per_ray)` containing
|
||||
the ray-specific emission-absorbtion distribution.
|
||||
the ray-specific emission-absorption distribution.
|
||||
Each ray distribution `(..., :)` is a valid probability
|
||||
distribution, i.e. it contains non-negative values that integrate
|
||||
to 1, such that `weights.sum(dim=-1)==1).all()` yields `True`.
|
||||
|
||||
@@ -60,7 +60,7 @@ def main(cfg: DictConfig):
|
||||
print(f"Loading checkpoint {checkpoint_path}.")
|
||||
loaded_data = torch.load(checkpoint_path)
|
||||
# Do not load the cached xy grid.
|
||||
# - this allows to set an arbitrary evaluation image size.
|
||||
# - this allows setting an arbitrary evaluation image size.
|
||||
state_dict = {
|
||||
k: v
|
||||
for k, v in loaded_data["model"].items()
|
||||
@@ -121,7 +121,7 @@ def main(cfg: DictConfig):
|
||||
test_image = test_image.to(device)
|
||||
test_camera = test_camera.to(device)
|
||||
|
||||
# Activate eval mode of the model (allows to do a full rendering pass).
|
||||
# Activate eval mode of the model (lets us do a full rendering pass).
|
||||
model.eval()
|
||||
with torch.no_grad():
|
||||
test_nerf_out, test_metrics = model(
|
||||
|
||||
@@ -70,7 +70,7 @@ class TestRaysampler(unittest.TestCase):
|
||||
|
||||
def test_probabilistic_raysampler(self, batch_size=1, n_pts_per_ray=60):
|
||||
"""
|
||||
Check that the probabilisitc ray sampler does not crash for various
|
||||
Check that the probabilistic ray sampler does not crash for various
|
||||
settings.
|
||||
"""
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ def main(cfg: DictConfig):
|
||||
else:
|
||||
warnings.warn(
|
||||
"Please note that although executing on CPU is supported,"
|
||||
+ "the training is unlikely to finish in resonable time."
|
||||
+ "the training is unlikely to finish in reasonable time."
|
||||
)
|
||||
device = "cpu"
|
||||
|
||||
@@ -109,7 +109,7 @@ def main(cfg: DictConfig):
|
||||
optimizer, lr_lambda, last_epoch=start_epoch - 1, verbose=False
|
||||
)
|
||||
|
||||
# Initialize the cache for storing variables needed for visulization.
|
||||
# Initialize the cache for storing variables needed for visualization.
|
||||
visuals_cache = collections.deque(maxlen=cfg.visualization.history_size)
|
||||
|
||||
# Init the visualization visdom env.
|
||||
@@ -194,7 +194,7 @@ def main(cfg: DictConfig):
|
||||
if iteration % cfg.stats_print_interval == 0:
|
||||
stats.print(stat_set="train")
|
||||
|
||||
# Update the visualisatioon cache.
|
||||
# Update the visualization cache.
|
||||
visuals_cache.append(
|
||||
{
|
||||
"camera": camera.cpu(),
|
||||
@@ -219,7 +219,7 @@ def main(cfg: DictConfig):
|
||||
val_image = val_image.to(device)
|
||||
val_camera = val_camera.to(device)
|
||||
|
||||
# Activate eval mode of the model (allows to do a full rendering pass).
|
||||
# Activate eval mode of the model (lets us do a full rendering pass).
|
||||
model.eval()
|
||||
with torch.no_grad():
|
||||
val_nerf_out, val_metrics = model(
|
||||
|
||||
Reference in New Issue
Block a user