mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-11 10:34:29 +08:00
[Fix] convert camera_idx to tensor (#2890)
convert camera_idx to tensor
This commit is contained in:
parent
1d070f5625
commit
efa91e5df7
@ -157,7 +157,7 @@ class CameraOptimizer(nn.Module):
|
||||
assert camera.metadata is not None, "Must provide id of camera in its metadata"
|
||||
assert "cam_idx" in camera.metadata, "Must provide id of camera in its metadata"
|
||||
camera_idx = camera.metadata["cam_idx"]
|
||||
adj = self([camera_idx]) # type: ignore
|
||||
adj = self(torch.tensor([camera_idx], dtype=torch.long, device=camera.device)) # type: ignore
|
||||
adj = torch.cat([adj, torch.Tensor([0, 0, 0, 1])[None, None].to(adj)], dim=1)
|
||||
camera.camera_to_worlds = torch.bmm(camera.camera_to_worlds, adj)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user