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:
Terrance WangandEthan Weber authored and GitHub committed 2022-08-31 23:29:13 -07:00
1 parent 6ee6934581
commit 8670f19d2d
13 files changed
+394 -52

No files matched your search

+12 -6
View File
@@ -41,7 +41,11 @@ from nerfactory.renderers.renderers import (
RGBRenderer,
)
from nerfactory.utils import colors, misc, visualization, writer
from nerfactory.utils.callbacks import Callback
from nerfactory.utils.callbacks import (
TrainingCallback,
TrainingCallbackAttributes,
TrainingCallbackLocation,
)
class NeRFModel(Model):
@@ -69,20 +73,22 @@ class NeRFModel(Model):
**kwargs,
)
def get_training_callbacks(self) -> List[Callback]:
def get_training_callbacks(
self, training_callback_attributes: TrainingCallbackAttributes # pylint: disable=unused-argument
) -> List[TrainingCallback]:
if self.field_coarse is None:
raise ValueError("populate fields must be called before get_training_callbacks.")
callbacks = []
if self.density_field is not None:
callbacks = [
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_coarse.density_fn,
kwargs={"density_eval_func": self.field.density_fn}, # type: ignore
)
]
return callbacks # type: ignore
return callbacks
def populate_fields(self):
"""Set the fields."""