camera_utils: add "vertical" orientation and "focus" center methods (#1543)

* camera_utils: add "vertical" orientation and "focus" center methods

* camera_utils: -Z is the look-at direction

* Update nerfstudio_dataparser.py

* missing import

* fix pylint issues

* camera_utils: handle degenerate case for "vertical" orientation method

* camera_utils: split focus_of_attention computation

---------

Co-authored-by: Frédéric Devernay <f-dy@users.noreply.github.com>
This commit is contained in:
Frédéric DevernayandFrédéric Devernay authored and GitHub committed 2023-03-10 11:22:21 -08:00
1 parent 510188b1e6
commit a277cd4886
7 files changed
+157 -35

No files matched your search

@@ -54,10 +54,10 @@ class NerfstudioDataParserConfig(DataParserConfig):
"""How much to downscale images. If not set, images are chosen such that the max dimension is <1600px."""
scene_scale: float = 1.0
"""How much to scale the region of interest by."""
orientation_method: Literal["pca", "up", "none"] = "up"
orientation_method: Literal["pca", "up", "vertical", "none"] = "up"
"""The method to use for orientation."""
center_poses: bool = True
"""Whether to center the poses."""
center_method: Literal["poses", "focus", "none"] = "poses"
"""The method to use to center the poses."""
auto_scale_poses: bool = True
"""Whether to automatically scale the poses to fit in +/- 1 bounding box."""
train_split_fraction: float = 0.9
@@ -209,7 +209,7 @@ class Nerfstudio(DataParser):
poses, transform_matrix = camera_utils.auto_orient_and_center_poses(
poses,
method=orientation_method,
center_poses=self.config.center_poses,
center_method=self.config.center_method,
)
# Scale poses