mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-18 22:04:02 +08:00
[WIP] dataloading cleanup (#332)
* testing; need to merge * fixing wrong base file in models/base * pushed input parser into datasets class to abstract away fetching data in dataloader * slight name chage and all * nits * added dataparser * added licnese
This commit is contained in:
1 parent
e907bc5c71
commit
56113e6c75
29 files changed
+1048
-960
No files matched your search
@@ -55,7 +55,7 @@ for dataset in ${DATASETS[@]}; do
|
||||
python scripts/run_train.py \
|
||||
${config_name} \
|
||||
--logging.writer.2.no-enable \
|
||||
--pipeline.data_manager.train-dataset.data-directory=data/blender/${dataset} \
|
||||
--pipeline.datamanager.train-dataset.data-directory=data/blender/${dataset} \
|
||||
--experiment-name=blender_${dataset}_${tag} \
|
||||
--trainer.model-dir=nerfactory_models/ \
|
||||
--trainer.steps-per-save=16000 \
|
||||
|
||||
+5
-5
@@ -79,7 +79,7 @@ def _render_stats_dict(pipeline: Pipeline) -> Dict[str, float]:
|
||||
avg_psnr = 0
|
||||
avg_rays_per_sec = 0
|
||||
avg_fps = 0
|
||||
for step, (camera_ray_bundle, batch) in tqdm(enumerate(pipeline.data_manager.eval_dataloader)):
|
||||
for step, (camera_ray_bundle, batch) in tqdm(enumerate(pipeline.datamanager.eval_dataloader)):
|
||||
with TimeWriter(writer=None, name=None, write=False) as t:
|
||||
with torch.no_grad():
|
||||
image_idx = int(camera_ray_bundle.camera_indices[0, 0])
|
||||
@@ -142,7 +142,7 @@ def _eval_setup(config_path: Path) -> Tuple[cfg.Config, Pipeline, Path]:
|
||||
# load checkpoints from wherever they were saved
|
||||
# TODO: expose the ability to choose an arbitrary checkpoint
|
||||
config.trainer.load_dir = config.trainer.model_dir
|
||||
config.pipeline.data_manager.eval_image_indices = None
|
||||
config.pipeline.datamanager.eval_image_indices = None
|
||||
|
||||
# setup pipeline (which includes the DataManager)
|
||||
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
||||
@@ -210,11 +210,11 @@ class RenderTrajectory:
|
||||
|
||||
# TODO(ethan): use camera information from parsing args
|
||||
if self.traj == "spiral":
|
||||
camera_start = pipeline.data_manager.eval_dataloader.get_camera(image_idx=0)
|
||||
camera_start = pipeline.datamanager.eval_dataloader.get_camera(image_idx=0)
|
||||
# TODO(ethan): pass in the up direction of the camera
|
||||
camera_path = get_spiral_path(camera_start, steps=30, radius=0.1)
|
||||
elif self.traj == "interp":
|
||||
cameras = pipeline.data_manager.eval_dataloader.get_camera(image_idx=[0, 10])
|
||||
cameras = pipeline.datamanager.eval_dataloader.get_camera(image_idx=[0, 10])
|
||||
camera_path = get_interpolated_camera_path(cameras, steps=30)
|
||||
else:
|
||||
assert_never(self.traj)
|
||||
@@ -225,7 +225,7 @@ class RenderTrajectory:
|
||||
output_filename=self.output_path,
|
||||
rendered_output_name=self.rendered_output_name,
|
||||
rendered_resolution_scaling_factor=self.rendered_resolution_scaling_factor,
|
||||
num_rays_per_chunk=config.pipeline.data_manager.eval_num_rays_per_chunk,
|
||||
num_rays_per_chunk=config.pipeline.datamanager.eval_num_rays_per_chunk,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user