misc cleanup (#432)

* misc cuda improvements. added cone angle as param

* wandb as default. better organization for experiments

* turn off tensorboard

* disable eval when using viewer

* remove comment

* launch.json
This commit is contained in:
Ethan Weber authored and GitHub committed 2022-09-15 00:16:41 -07:00
1 parent ef8c4fbe23
commit 8973039e65
21 files changed
+230 -111

No files matched your search

+11 -3
View File
@@ -48,7 +48,7 @@ def get_normalized_directions(directions: TensorType["bs":..., 3]):
class TCNNInstantNGPField(Field):
"""NeRF Field
"""TCNN implementation of the Instant-NGP field.
Args:
aabb: parameters of scene aabb bounds
@@ -120,6 +120,11 @@ class TCNNInstantNGPField(Field):
def get_density(self, ray_samples: RaySamples):
positions = SceneBounds.get_normalized_positions(ray_samples.frustums.get_positions(), self.aabb)
positions_flat = positions.view(-1, 3)
# assert all positions are in the range [0, 1]
# otherwise print min and max values
# assert torch.all(positions >= 0.0) and torch.all(
# positions <= 1.0
# ), f"positions: {positions.min()} {positions.max()}"
h = self.mlp_base(positions_flat).view(*ray_samples.frustums.shape, -1)
density_before_activation, base_mlp_out = torch.split(h, [1, self.geo_feat_dim], dim=-1)
@@ -131,9 +136,12 @@ class TCNNInstantNGPField(Field):
def get_outputs(self, ray_samples: RaySamples, density_embedding: Optional[TensorType] = None):
# TODO: add valid_mask masking!
# tcnn requires directions in the range [0,1]
directions = get_normalized_directions(ray_samples.frustums.directions)
directions_flat = directions.view(-1, 3)
# assert all directions are in the range [0, 1]
# assert torch.all(directions >= 0.0) and torch.all(
# directions <= 1.0
# ), f"directions: {directions.min()} {directions.max()}"
d = self.direction_encoding(directions_flat)
if density_embedding is None:
positions = SceneBounds.get_normalized_positions(ray_samples.frustums.get_positions(), self.aabb)
@@ -146,7 +154,7 @@ class TCNNInstantNGPField(Field):
class TorchInstantNGPField(NeRFField):
"""
PyTorch implementation of the instant-ngp field.
PyTorch implementation of the Instant-NGP field.
"""
def __init__(