mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-07 00:09:14 +08:00
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:
1 parent
281f81f1ec
commit
01d57b90dc
2 files changed
+6
-5
No files matched your search
@@ -259,15 +259,15 @@ class Viewer:
|
|||||||
with torch.no_grad():
|
with torch.no_grad():
|
||||||
assert isinstance(camera_optimizer, CameraOptimizer)
|
assert isinstance(camera_optimizer, CameraOptimizer)
|
||||||
c2ws_delta = camera_optimizer(torch.tensor(idxs, device=camera_optimizer.device)).cpu().numpy()
|
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
|
# both are numpy arrays
|
||||||
c2w_orig = self.original_c2w[idx]
|
c2w_orig = self.original_c2w[key]
|
||||||
c2w_delta = c2ws_delta[idx, ...]
|
c2w_delta = c2ws_delta[i, ...]
|
||||||
c2w = c2w_orig @ np.concatenate((c2w_delta, np.array([[0, 0, 0, 1]])), axis=0)
|
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 = vtf.SO3.from_matrix(c2w[:3, :3]) # type: ignore
|
||||||
R = R @ vtf.SO3.from_x_radians(np.pi)
|
R = R @ vtf.SO3.from_x_radians(np.pi)
|
||||||
self.camera_handles[idx].position = c2w[:3, 3] * VISER_NERFSTUDIO_SCALE_RATIO
|
self.camera_handles[key].position = c2w[:3, 3] * VISER_NERFSTUDIO_SCALE_RATIO
|
||||||
self.camera_handles[idx].wxyz = R.wxyz
|
self.camera_handles[key].wxyz = R.wxyz
|
||||||
|
|
||||||
def _interrupt_render(self, _) -> None:
|
def _interrupt_render(self, _) -> None:
|
||||||
"""Interrupt current render."""
|
"""Interrupt current render."""
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ pythonVersion = "3.8"
|
|||||||
pythonPlatform = "Linux"
|
pythonPlatform = "Linux"
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
|
line-length = 120
|
||||||
select = [
|
select = [
|
||||||
"E", # pycodestyle errors.
|
"E", # pycodestyle errors.
|
||||||
"F", # Pyflakes rules.
|
"F", # Pyflakes rules.
|
||||||
|
|||||||
Reference in new issue
Block a user