Skip to content

Commit

Permalink
fix exporter.py for FullImageDataManager and RandomCamerasDataManager (
Browse files Browse the repository at this point in the history
…nerfstudio-project#3065)

* fix exporter.py for FullImageDataManager and RandomCamerasDataManager

* sort imports

* ruff

---------

Co-authored-by: Brent Yi <yibrenth@gmail.com>
  • Loading branch information
dberga and brentyi committed Apr 11, 2024
1 parent c381fc8 commit 2d9bbe5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions nerfstudio/scripts/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@

from nerfstudio.cameras.rays import RayBundle
from nerfstudio.data.datamanagers.base_datamanager import VanillaDataManager
from nerfstudio.data.datamanagers.full_images_datamanager import FullImageDatamanager
from nerfstudio.data.datamanagers.parallel_datamanager import ParallelDataManager
from nerfstudio.data.datamanagers.random_cameras_datamanager import RandomCamerasDataManager
from nerfstudio.data.scene_box import OrientedBox
from nerfstudio.exporter import texture_utils, tsdf_utils
from nerfstudio.exporter.exporter_utils import collect_camera_poses, generate_point_cloud, get_mesh_from_filename
Expand Down Expand Up @@ -137,7 +139,10 @@ def main(self) -> None:
validate_pipeline(self.normal_method, self.normal_output_name, pipeline)

# Increase the batchsize to speed up the evaluation.
assert isinstance(pipeline.datamanager, (VanillaDataManager, ParallelDataManager))
assert isinstance(
pipeline.datamanager,
(VanillaDataManager, ParallelDataManager, FullImageDatamanager, RandomCamerasDataManager),
)
assert pipeline.datamanager.train_pixel_sampler is not None
pipeline.datamanager.train_pixel_sampler.num_rays_per_batch = self.num_rays_per_batch

Expand Down Expand Up @@ -318,7 +323,10 @@ def main(self) -> None:
validate_pipeline(self.normal_method, self.normal_output_name, pipeline)

# Increase the batchsize to speed up the evaluation.
assert isinstance(pipeline.datamanager, (VanillaDataManager, ParallelDataManager))
assert isinstance(
pipeline.datamanager,
(VanillaDataManager, ParallelDataManager, FullImageDatamanager, RandomCamerasDataManager),
)
assert pipeline.datamanager.train_pixel_sampler is not None
pipeline.datamanager.train_pixel_sampler.num_rays_per_batch = self.num_rays_per_batch

Expand Down

0 comments on commit 2d9bbe5

Please sign in to comment.