mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-03 14:28:41 +08:00
Improving eval script with camera trajectory videos (#124)
* spiral traj working, specify version for hydra, better documentation * cleaned up spiral trajectory a bit
This commit is contained in:
1 parent
7cda0158c7
commit
4ddd146633
16 files changed
+3379
-769
No files matched your search
@@ -22,7 +22,7 @@ from omegaconf import ListConfig
|
||||
|
||||
from torchtyping import TensorType
|
||||
|
||||
from pyrad.cameras.cameras import get_camera
|
||||
from pyrad.cameras.cameras import Camera, get_camera
|
||||
from pyrad.cameras.rays import RayBundle
|
||||
from pyrad.data.image_dataset import ImageDataset
|
||||
from pyrad.data.image_sampler import ImageSampler
|
||||
@@ -116,11 +116,16 @@ class EvalDataloader: # pylint: disable=too-few-public-methods
|
||||
self.device = device
|
||||
self.kwargs = kwargs
|
||||
|
||||
def get_data_from_image_idx(self, image_idx) -> Tuple[RayBundle, Dict]:
|
||||
"""Returns the data for a specific image index."""
|
||||
def get_camera(self, image_idx) -> Camera:
|
||||
"""Get camera for the given image index"""
|
||||
intrinsics = self.intrinsics[image_idx].to(self.device)
|
||||
camera_to_world = self.camera_to_world[image_idx].to(self.device)
|
||||
camera = get_camera(intrinsics, camera_to_world, camera_index=image_idx)
|
||||
return camera
|
||||
|
||||
def get_data_from_image_idx(self, image_idx) -> Tuple[RayBundle, Dict]:
|
||||
"""Returns the data for a specific image index."""
|
||||
camera = self.get_camera(image_idx)
|
||||
ray_bundle = camera.get_camera_ray_bundle(device=self.device)
|
||||
ray_bundle.num_rays_per_chunk = self.num_rays_per_chunk
|
||||
batch = self.image_dataset[image_idx]
|
||||
|
||||
Reference in new issue
Block a user