mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-23 16:15:36 +08:00
instant-ngp-bounded model (#1116)
* inerted a new model configuration instant-ngp-bounded * added more remarks and small fixes * went back to old near plane * added the oprtion to get a file as well as directory in nerfstudio data parser * pretify prev commit * review fixes * more clear explanation in README.md * reverted readme changes * fixed merge bug * review changes. update config.data docs support for json files inputs Co-authored-by: dror <you@example.com>
This commit is contained in:
1 parent
21e0ec6cd8
commit
96f269cc1a
7 files changed
+123
-34
No files matched your search
@@ -28,6 +28,7 @@ from torch.nn import Parameter
|
||||
from torchmetrics import PeakSignalNoiseRatio
|
||||
from torchmetrics.functional import structural_similarity_index_measure
|
||||
from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity
|
||||
from typing_extensions import Literal
|
||||
|
||||
from nerfstudio.cameras.rays import RayBundle
|
||||
from nerfstudio.engine.callbacks import (
|
||||
@@ -76,8 +77,8 @@ class InstantNGPModelConfig(ModelConfig):
|
||||
"""How far along ray to stop sampling."""
|
||||
use_appearance_embedding: bool = False
|
||||
"""Whether to use an appearance embedding."""
|
||||
randomize_background: bool = True
|
||||
"""Whether to randomize the background color."""
|
||||
background_color: Literal["random", "black", "white"] = "random"
|
||||
"""The color that is given to untrained areas."""
|
||||
|
||||
|
||||
class NGPModel(Model):
|
||||
@@ -122,7 +123,10 @@ class NGPModel(Model):
|
||||
)
|
||||
|
||||
# renderers
|
||||
background_color = "random" if self.config.randomize_background else colors.WHITE
|
||||
background_color = "random"
|
||||
if self.config.background_color in ["white", "black"]:
|
||||
background_color = colors.COLORS_DICT[self.config.background_color]
|
||||
|
||||
self.renderer_rgb = RGBRenderer(background_color=background_color)
|
||||
self.renderer_accumulation = AccumulationRenderer()
|
||||
self.renderer_depth = DepthRenderer(method="expected")
|
||||
|
||||
Reference in new issue
Block a user