Pose optimization (#721)

* pose opt default nerfacto.

* added SO3 cam pose optimization which is slightly faster (~2.2m/iter) than BARF

* integrating record3d

* fix linting errors

* fix save checkpoint logic

* added record3d data

* workaround to avoid flag

* moved dict

* black

* record3d docs

* re-add typing to exp_map.

* Pose optimization refactor

* Fix camera optimizer param group logic

* Update docs + comments

* Update docs, shorten names

* Appease pylint

* repeat -> tile, apply missing name change

* Fix optimizer as scheduler bug

* Fix test

Co-authored-by: akristoffersen <akristoffersen@berkeley.edu>
Co-authored-by: Justin Kerr <justin.g.kerr@gmail.com>
Co-authored-by: Brent Yi <yibrenth@gmail.com>
This commit is contained in:
authored and GitHub committed 2022-10-07 10:11:33 -07:00
1 parent 2531242d1d
commit cac177717f
8 files changed
+230 -103

No files matched your search

+6 -3
View File
@@ -249,14 +249,17 @@ class VanillaPipeline(Pipeline):
ray_bundle, batch = self.datamanager.next_train(step)
model_outputs = self.model(ray_bundle)
metrics_dict = self.model.get_metrics_dict(model_outputs, batch)
if "camera_opt" in self.datamanager.get_param_groups():
camera_opt_param_group = self.config.datamanager.camera_optimizer.param_group
if camera_opt_param_group in self.datamanager.get_param_groups():
# Report the camera optimization metrics
metrics_dict["camera_opt_translation"] = (
self.datamanager.get_param_groups()["camera_opt"][0].data[:, :3].norm()
self.datamanager.get_param_groups()[camera_opt_param_group][0].data[:, :3].norm()
)
metrics_dict["camera_opt_rotation"] = (
self.datamanager.get_param_groups()["camera_opt"][0].data[:, 3:].norm()
self.datamanager.get_param_groups()[camera_opt_param_group][0].data[:, 3:].norm()
)
loss_dict = self.model.get_loss_dict(model_outputs, batch, metrics_dict)
return model_outputs, loss_dict, metrics_dict