mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-22 23:55:36 +08:00
Config restructure (#283)
* starting docs for pipelines * working on an example * clearing output * starting to implement config changes and add documentation * wip: removed cicular imports; porting basic config into python; todo: get python setups workin * circular imports again * wip: pausing at dataloader sort of working * break for today * running vanilla * wip need to get all the config docs working * laptop about to die * instant ngp working * added all configs for all methods; not tested yet: [mipnerf360, nerfw, semantic_nerf] * unpacking later * done with pylinting * mostly done. just need to do docs and one test * added import order to docs * fixing near/far plane and other config things * making loggers also instantiable via configs * docs * lint * making --help work with dcargs * moving configs back into flat * convert list to tuples; fixed post init function with mutable params * lint * made run_eval and benchmarking scripts compatible with new config/dcargs * lint * added option to load configs from presaved config Co-authored-by: evonneng <evonne_ng@berkeley.edu>
This commit is contained in:
1 parent
e0856e3afc
commit
7e9a56fac4
46 files changed
+987
-916
No files matched your search
@@ -15,6 +15,9 @@
|
||||
"""
|
||||
Code to implement the density grid.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Callable, List, Tuple, Union
|
||||
|
||||
import torch
|
||||
@@ -81,12 +84,7 @@ class DensityGrid(nn.Module):
|
||||
mean_density: TensorType[1]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
center: float = 0.0,
|
||||
base_scale: float = 1.0,
|
||||
num_cascades: int = 1,
|
||||
resolution: int = 128,
|
||||
update_every_num_iters: int = 16,
|
||||
self, center: float, base_scale: float, num_cascades: int, resolution: int, update_every_num_iters: int
|
||||
) -> None:
|
||||
super().__init__()
|
||||
self.center = center
|
||||
@@ -102,7 +100,7 @@ class DensityGrid(nn.Module):
|
||||
self.register_buffer("density_bitfield", density_bitfield)
|
||||
|
||||
# Integer grid coords / indices that do not related to cascades
|
||||
grid_coords = _create_grid_coords(resolution)
|
||||
grid_coords = _create_grid_coords(self.resolution)
|
||||
# TODO(ruilongli): hacky way for now. support cpu version of morton3D?
|
||||
grid_indices = nerfactory_cuda.morton3D(grid_coords.to("cuda:0")).to("cpu")
|
||||
self.register_buffer("grid_coords", grid_coords)
|
||||
|
||||
Reference in new issue
Block a user