4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 02:24:38 +08:00

fix tests

This commit is contained in:
Ethan Weber 2023-04-07 22:00:04 +00:00
parent 984f36738a
commit c3e67ffd5f
4 changed files with 22 additions and 16 deletions

View File

@ -0,0 +1,14 @@
# CleaNeRF
### Running the Method
```bash
pip install cleanerf
ns-train cleanerf --help
```
## Method
### Overview
TODO

View File

@ -31,4 +31,5 @@ In addition to their implementations, we have provided guides that walk through
Nerfacto<nerfacto.md>
Instant-NGP<instant_ngp.md>
Semantic NeRF-W<semantic_nerfw.md>
CleaNeRF<cleanerf.md>
```

View File

@ -230,14 +230,6 @@ class RandIndicesEvalDataloader(EvalDataloader):
device: Device to load data to
"""
def __init__(
self,
input_dataset: InputDataset,
device: Union[torch.device, str] = "cpu",
**kwargs,
):
super().__init__(input_dataset, device, **kwargs)
def __iter__(self):
return self

View File

@ -36,7 +36,6 @@ from nerfstudio.cameras.camera_paths import (
from nerfstudio.cameras.cameras import Cameras, CameraType
from nerfstudio.data.scene_box import SceneBox
from nerfstudio.model_components import renderers
from nerfstudio.model_components.renderers import DepthRenderer
from nerfstudio.pipelines.base_pipeline import Pipeline
from nerfstudio.utils import colormaps, install_checks
from nerfstudio.utils.eval_utils import eval_setup
@ -57,6 +56,7 @@ def _render_trajectory_video(
camera_type: CameraType = CameraType.PERSPECTIVE,
depth_near_plane: Optional[float] = None,
depth_far_plane: Optional[float] = None,
using_eval_images: bool = False,
) -> None:
"""Helper function to create a video of the spiral trajectory.
@ -72,16 +72,15 @@ def _render_trajectory_video(
camera_type: Camera projection format type.
depth_near_plane: Closest depth to consider. If None, use min image value.
depth_far_plane: Furthest depth to consider. If None, use max image value.
using_eval_images: Whether the eval images are being used or not.
depth_method: Method to use for depth rendering. If None, use model default.
"""
# pylint: disable=too-many-statements
CONSOLE.print("[bold green]Creating trajectory " + output_format)
cameras.rescale_output_resolution(rendered_resolution_scaling_factor)
cameras = cameras.to(pipeline.device)
fps = len(cameras) / seconds
# set the pipeline to use median depth
# TODO(ethan): don't hardcode this...
pipeline.model.renderer_depth = DepthRenderer(method="median")
progress = Progress(
TextColumn(":movie_camera: Rendering :movie_camera:"),
BarColumn(),
@ -153,9 +152,8 @@ def _render_trajectory_video(
output_image = np.concatenate((output_image,) * 3, axis=-1)
render_image.append(output_image)
# TODO: check for eval-images mode
# if, so then save the GT image as well!
if True:
if using_eval_images:
# if in the eval-images mode, then save the GT images as well
batch = pipeline.datamanager.eval_dataloader.input_dataset[camera_idx]
rgb_gt = batch["image"]
# resize to match the rendered image
@ -390,6 +388,7 @@ class RenderTrajectory:
camera_type=camera_type,
depth_near_plane=self.depth_near_plane,
depth_far_plane=self.depth_far_plane,
using_eval_images=self.traj == "eval-images",
)