mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-05 23:38:42 +08:00
Config fixes
This commit is contained in:
1 parent
e5873d8dba
commit
9c061f2a99
2 files changed
+41
-23
No files matched your search
@@ -23,10 +23,25 @@ from collections import defaultdict
|
|||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from functools import cached_property
|
from functools import cached_property
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import (Any, Callable, Dict, ForwardRef, Generic, List, Literal,
|
from typing import (
|
||||||
Optional, Tuple, Type, Union, cast, get_args, get_origin)
|
Any,
|
||||||
|
Callable,
|
||||||
|
Dict,
|
||||||
|
ForwardRef,
|
||||||
|
Generic,
|
||||||
|
List,
|
||||||
|
Literal,
|
||||||
|
Optional,
|
||||||
|
Tuple,
|
||||||
|
Type,
|
||||||
|
Union,
|
||||||
|
cast,
|
||||||
|
get_args,
|
||||||
|
get_origin,
|
||||||
|
)
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
|
import tyro
|
||||||
from torch import nn
|
from torch import nn
|
||||||
from torch.nn import Parameter
|
from torch.nn import Parameter
|
||||||
from torch.utils.data.distributed import DistributedSampler
|
from torch.utils.data.distributed import DistributedSampler
|
||||||
@@ -38,17 +53,20 @@ from nerfstudio.cameras.rays import RayBundle
|
|||||||
from nerfstudio.configs.base_config import InstantiateConfig
|
from nerfstudio.configs.base_config import InstantiateConfig
|
||||||
from nerfstudio.configs.dataparser_configs import AnnotatedDataParserUnion
|
from nerfstudio.configs.dataparser_configs import AnnotatedDataParserUnion
|
||||||
from nerfstudio.data.dataparsers.base_dataparser import DataparserOutputs
|
from nerfstudio.data.dataparsers.base_dataparser import DataparserOutputs
|
||||||
from nerfstudio.data.dataparsers.blender_dataparser import \
|
from nerfstudio.data.dataparsers.blender_dataparser import BlenderDataParserConfig
|
||||||
BlenderDataParserConfig
|
|
||||||
from nerfstudio.data.datasets.base_dataset import InputDataset
|
from nerfstudio.data.datasets.base_dataset import InputDataset
|
||||||
from nerfstudio.data.pixel_samplers import (PatchPixelSamplerConfig,
|
from nerfstudio.data.pixel_samplers import (
|
||||||
PixelSampler, PixelSamplerConfig)
|
PatchPixelSamplerConfig,
|
||||||
from nerfstudio.data.utils.dataloaders import (CacheDataloader,
|
PixelSampler,
|
||||||
FixedIndicesEvalDataloader,
|
PixelSamplerConfig,
|
||||||
RandIndicesEvalDataloader)
|
)
|
||||||
|
from nerfstudio.data.utils.dataloaders import (
|
||||||
|
CacheDataloader,
|
||||||
|
FixedIndicesEvalDataloader,
|
||||||
|
RandIndicesEvalDataloader,
|
||||||
|
)
|
||||||
from nerfstudio.data.utils.nerfstudio_collate import nerfstudio_collate
|
from nerfstudio.data.utils.nerfstudio_collate import nerfstudio_collate
|
||||||
from nerfstudio.engine.callbacks import (TrainingCallback,
|
from nerfstudio.engine.callbacks import TrainingCallback, TrainingCallbackAttributes
|
||||||
TrainingCallbackAttributes)
|
|
||||||
from nerfstudio.model_components.ray_generators import RayGenerator
|
from nerfstudio.model_components.ray_generators import RayGenerator
|
||||||
from nerfstudio.utils.misc import IterableWrapper, get_orig_class
|
from nerfstudio.utils.misc import IterableWrapper, get_orig_class
|
||||||
from nerfstudio.utils.rich_utils import CONSOLE
|
from nerfstudio.utils.rich_utils import CONSOLE
|
||||||
@@ -95,7 +113,7 @@ class DataManagerConfig(InstantiateConfig):
|
|||||||
"""Target class to instantiate."""
|
"""Target class to instantiate."""
|
||||||
data: Optional[Path] = None
|
data: Optional[Path] = None
|
||||||
"""Source of data, may not be used by all models."""
|
"""Source of data, may not be used by all models."""
|
||||||
camera_optimizer: Optional[CameraOptimizerConfig] = None
|
camera_optimizer: tyro.conf.AvoidSubcommands[Optional[CameraOptimizerConfig]] = None
|
||||||
"""Specifies the camera pose optimizer used during training. Helpful if poses are noisy."""
|
"""Specifies the camera pose optimizer used during training. Helpful if poses are noisy."""
|
||||||
masks_on_gpu: bool = False
|
masks_on_gpu: bool = False
|
||||||
"""Process masks on GPU for speed at the expense of memory, if True."""
|
"""Process masks on GPU for speed at the expense of memory, if True."""
|
||||||
|
|||||||
@@ -60,17 +60,17 @@ from nerfstudio.utils import poses as pose_utils
|
|||||||
class GaussianSplattingModelConfig(ModelConfig):
|
class GaussianSplattingModelConfig(ModelConfig):
|
||||||
"""Gaussian Splatting Model Config"""
|
"""Gaussian Splatting Model Config"""
|
||||||
_target: Type = field(default_factory=lambda: GaussianSplattingModel)
|
_target: Type = field(default_factory=lambda: GaussianSplattingModel)
|
||||||
initial_ptc_size = 100000
|
initial_ptc_size: int = 100000
|
||||||
max_ptc_size = 100000
|
max_ptc_size: int = 100000
|
||||||
render_accumulation = False
|
render_accumulation: bool = False
|
||||||
use_aabb = True
|
use_aabb: bool = True
|
||||||
initial_gaussian_scales = -3
|
initial_gaussian_scales: int = -3
|
||||||
prune_density_after = 500
|
prune_density_after: int = 500
|
||||||
prune_density_every = 100
|
prune_density_every: int = 100
|
||||||
prune_density_until = 15000
|
prune_density_until: int = 15000
|
||||||
one_up_sh_every = 1000
|
one_up_sh_every: int = 1000
|
||||||
lambda_ssim = 0.2
|
lambda_ssim: float = 0.2
|
||||||
use_diff_rast = False # TODO (jake-austin): remove
|
use_diff_rast: bool = False # TODO (jake-austin): remove
|
||||||
|
|
||||||
class GaussianSplattingModel(Model):
|
class GaussianSplattingModel(Model):
|
||||||
"""Gaussian Splatting model
|
"""Gaussian Splatting model
|
||||||
|
|||||||
Reference in new issue
Block a user