mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-19 22:25:44 +08:00
refactoring configs; pulled network out of graph; created trainer heirarchy (#51)
* changed config graph structure * removed network udner graphs; added new heirarchy trainer * fixed callback in occupancy graph * lint * changed register callback to setter method
This commit is contained in:
1 parent
41073540c1
commit
91ef54963c
19 files changed
+163
-134
No files matched your search
@@ -38,9 +38,9 @@ class Field(nn.Module):
|
||||
frustums=Frustums(
|
||||
origins=positions,
|
||||
directions=torch.ones_like(positions),
|
||||
frustum_starts=torch.zeros((*positions.shape[:-1], 1)),
|
||||
frustum_ends=torch.zeros((*positions.shape[:-1], 1)),
|
||||
pixel_area=torch.ones((*positions.shape[:-1], 1)),
|
||||
frustum_starts=torch.zeros_like((positions[..., :1])),
|
||||
frustum_ends=torch.zeros_like((positions[..., :1])),
|
||||
pixel_area=torch.ones_like((positions[..., :1])),
|
||||
)
|
||||
)
|
||||
density, _ = self.get_density(point_samples)
|
||||
|
||||
@@ -28,7 +28,7 @@ class OccupancyGrid(nn.Module):
|
||||
"""Module to keep track of the density and occupancy."""
|
||||
|
||||
def __init__(
|
||||
self, num_cascades: int = 1, resolution: int = 128, aabb=None, density_fn=None, update_every_num_iters: int = 16
|
||||
self, num_cascades: int = 1, resolution: int = 128, aabb=None, update_every_num_iters: int = 16
|
||||
) -> None:
|
||||
super().__init__()
|
||||
assert is_not_none(aabb), "The axis-aligned bounding box aabb is not defined!"
|
||||
@@ -42,9 +42,7 @@ class OccupancyGrid(nn.Module):
|
||||
self.register_buffer("occupancy_grid", occupancy_grid)
|
||||
self.mean_density = 0.0
|
||||
|
||||
self.density_fn = density_fn
|
||||
self.update_every_num_iters = update_every_num_iters
|
||||
self.iteration_count = 0
|
||||
|
||||
def reset(self):
|
||||
"""Zero out the occupancy grid."""
|
||||
@@ -67,7 +65,6 @@ class OccupancyGrid(nn.Module):
|
||||
"""
|
||||
# TODO(ethan): remove this pylint disable
|
||||
# pylint: disable=invalid-name
|
||||
|
||||
device = self.occupancy_grid.device
|
||||
|
||||
assert self.num_cascades == 1, "Still need to implement code for multiple cascades."
|
||||
|
||||
Reference in new issue
Block a user