Fix large dataset (> 512 images) training in viewer_beta (#2669)

* Fix large dataset (> 512 images) training in viewer_beta (#2586)

* fix index bug in update_camera_poses of viewer

* Set Ruff line lenth

---------

Co-authored-by: Gina Wu <42229107+ginazhouhuiwu@users.noreply.github.com>
This commit is contained in:
Brent YiandGina Wu authored and GitHub committed 2023-12-12 11:44:26 +00:00
1 parent 281f81f1ec
commit 01d57b90dc
2 files changed
+6 -5

No files matched your search

+5 -5
View File
@@ -259,15 +259,15 @@ class Viewer:
with torch.no_grad():
assert isinstance(camera_optimizer, CameraOptimizer)
c2ws_delta = camera_optimizer(torch.tensor(idxs, device=camera_optimizer.device)).cpu().numpy()
for idx in idxs:
for i, key in enumerate(idxs):
# both are numpy arrays
c2w_orig = self.original_c2w[idx]
c2w_delta = c2ws_delta[idx, ...]
c2w_orig = self.original_c2w[key]
c2w_delta = c2ws_delta[i, ...]
c2w = c2w_orig @ np.concatenate((c2w_delta, np.array([[0, 0, 0, 1]])), axis=0)
R = vtf.SO3.from_matrix(c2w[:3, :3]) # type: ignore
R = R @ vtf.SO3.from_x_radians(np.pi)
self.camera_handles[idx].position = c2w[:3, 3] * VISER_NERFSTUDIO_SCALE_RATIO
self.camera_handles[idx].wxyz = R.wxyz
self.camera_handles[key].position = c2w[:3, 3] * VISER_NERFSTUDIO_SCALE_RATIO
self.camera_handles[key].wxyz = R.wxyz
def _interrupt_render(self, _) -> None:
"""Interrupt current render."""
+1
View File
@@ -162,6 +162,7 @@ pythonVersion = "3.8"
pythonPlatform = "Linux"
[tool.ruff]
line-length = 120
select = [
"E", # pycodestyle errors.
"F", # Pyflakes rules.