Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
kerrj authored Sep 4, 2024
2 parents 9e1f27d + 96b7fe2 commit c4953f1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
9 changes: 6 additions & 3 deletions nerfstudio/models/instant_ngp.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from __future__ import annotations

from dataclasses import dataclass, field
from typing import Dict, List, Literal, Optional, Tuple, Type
from typing import Dict, List, Literal, Optional, Tuple, Type, Union

import nerfacc
import torch
Expand Down Expand Up @@ -49,7 +49,7 @@ class InstantNGPModelConfig(ModelConfig):
"""Whether to create a scene collider to filter rays."""
collider_params: Optional[Dict[str, float]] = None
"""Instant NGP doesn't use a collider."""
grid_resolution: int = 128
grid_resolution: Union[int, List[int]] = 128
"""Resolution of the grid used for the field."""
grid_levels: int = 4
"""Levels of the grid used for the field."""
Expand All @@ -72,7 +72,10 @@ class InstantNGPModelConfig(ModelConfig):
use_appearance_embedding: bool = False
"""Whether to use an appearance embedding."""
background_color: Literal["random", "black", "white"] = "random"
"""The color that is given to untrained areas."""
"""
The color that is given to masked areas.
These areas are used to force the density in those regions to be zero.
"""
disable_scene_contraction: bool = False
"""Whether to disable scene contraction or not."""

Expand Down
11 changes: 7 additions & 4 deletions nerfstudio/process_data/images_to_nerfstudio_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ def main(self) -> None:
same_dimensions=self.same_dimensions,
keep_image_dir=False,
)
image_rename_map = dict(
(a.relative_to(self.data).as_posix(), b.name) for a, b in image_rename_map_paths.items()
)
if self.eval_data is not None:
eval_image_rename_map_paths = process_data_utils.copy_images(
self.eval_data,
Expand All @@ -85,11 +88,11 @@ def main(self) -> None:
same_dimensions=self.same_dimensions,
keep_image_dir=True,
)
image_rename_map_paths.update(eval_image_rename_map_paths)
eval_image_rename_map = dict(
(a.relative_to(self.eval_data).as_posix(), b.name) for a, b in eval_image_rename_map_paths.items()
)
image_rename_map.update(eval_image_rename_map)

image_rename_map = dict(
(a.relative_to(self.data).as_posix(), b.name) for a, b in image_rename_map_paths.items()
)
num_frames = len(image_rename_map)
summary_log.append(f"Starting with {num_frames} images")

Expand Down
2 changes: 1 addition & 1 deletion nerfstudio/utils/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def write_config(self, name: str, config_dict: Dict[str, Any], step: int):
"""
import wandb # wandb is slow to import, so we only import it if we need it.

wandb.config.update(config_dict, allow_val_change=True)
wandb.config.update(config_dict, allow_val_change=True) # type: ignore


@decorate_all([check_main_thread])
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "nerfstudio"
version = "1.1.3"
version = "1.1.4"
description = "All-in-one repository for state-of-the-art NeRFs"
readme = "README.md"
license = { text="Apache 2.0"}
Expand Down Expand Up @@ -56,7 +56,7 @@ dependencies = [
"torchvision>=0.14.1",
"torchmetrics[image]>=1.0.1",
"typing_extensions>=4.4.0",
"viser==0.2.3",
"viser==0.2.7",
"nuscenes-devkit>=1.1.1",
"wandb>=0.13.3",
"xatlas",
Expand Down

0 comments on commit c4953f1

Please sign in to comment.