mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-05 23:38:42 +08:00
Terrance/tensorf (#218)
* added tensorf, updated requirements for windows * cleaning up imports * tensorf changes * initial working version of tensorf * added callback for feature upsampling * modifying tests to match changes * reverting requirements changes * reverting unnecessary changes * reverting unnecessary changes * no more upsampling on step 0 * removed density field, fixed error msg * modified callbacks and upsampling, reinitializing optimzer in training loop * deleting tensorf_field file" * checkpointing progress on restructuring callbacks * updated callback logic for before and after train capabilities * fixing upsampling stepping * merging * adding tensorf to config, fixing some bugs with new callback * changed the way callbacks detected steps argument in callback func * fixing typing * adding pylint disable no self use to get_training_callbacks * fixing config * changing callback in vanilla nerf to allow for no density field * cleanup * removing config yaml Co-authored-by: Ethan Weber <eweb0124@gmail.com>
This commit is contained in:
1 parent
6ee6934581
commit
8670f19d2d
13 files changed
+394
-52
No files matched your search
@@ -35,7 +35,11 @@ from nerfactory.models.base import Model
|
||||
from nerfactory.models.modules.ray_sampler import NGPSpacedSampler
|
||||
from nerfactory.optimizers.loss import MSELoss
|
||||
from nerfactory.utils import colors, misc, visualization, writer
|
||||
from nerfactory.utils.callbacks import Callback
|
||||
from nerfactory.utils.callbacks import (
|
||||
TrainingCallback,
|
||||
TrainingCallbackAttributes,
|
||||
TrainingCallbackLocation,
|
||||
)
|
||||
|
||||
|
||||
class NGPModel(Model):
|
||||
@@ -51,13 +55,16 @@ class NGPModel(Model):
|
||||
self.field = None
|
||||
super().__init__(config=config, **kwargs)
|
||||
|
||||
def get_training_callbacks(self) -> List[Callback]:
|
||||
def get_training_callbacks(
|
||||
self, training_callback_attributes: TrainingCallbackAttributes
|
||||
) -> List[TrainingCallback]:
|
||||
assert self.density_field is not None
|
||||
return [
|
||||
Callback(
|
||||
TrainingCallback(
|
||||
where_to_run=[TrainingCallbackLocation.AFTER_TRAIN_ITERATION],
|
||||
update_every_num_iters=self.density_field.update_every_num_iters,
|
||||
func=self.density_field.update_density_grid,
|
||||
density_eval_func=self.field.density_fn, # type: ignore
|
||||
kwargs={"density_eval_func": self.field.density_fn}, # type: ignore
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
Reference in new issue
Block a user