mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-21 23:25:39 +08:00
1 parent
9d15ba6a2a
commit
c20fed83bb
61 files changed
+226
-332
No files matched your search
@@ -13,6 +13,6 @@
|
||||
# limitations under the License.
|
||||
|
||||
"""init field modules"""
|
||||
from .base import FieldModule
|
||||
from .encoding import Encoding, ScalingAndOffset
|
||||
from .base_field_component import FieldComponent
|
||||
from .encodings import Encoding, ScalingAndOffset
|
||||
from .mlp import MLP
|
||||
+1
-1
@@ -22,7 +22,7 @@ from torch import nn
|
||||
from torchtyping import TensorType
|
||||
|
||||
|
||||
class FieldModule(nn.Module):
|
||||
class FieldComponent(nn.Module):
|
||||
"""Field modules that can be combined to store and compute the fields.
|
||||
|
||||
Args:
|
||||
@@ -20,10 +20,10 @@ Code for embeddings.
|
||||
import torch
|
||||
from torchtyping import TensorType
|
||||
|
||||
from nerfstudio.field_components.base import FieldModule
|
||||
from nerfstudio.field_components.base_field_component import FieldComponent
|
||||
|
||||
|
||||
class Embedding(FieldModule):
|
||||
class Embedding(FieldComponent):
|
||||
"""Index into embeddings.
|
||||
# TODO: add different types of initializations
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@ import torch.nn.functional as F
|
||||
from torch import nn
|
||||
from torchtyping import TensorType
|
||||
|
||||
from nerfstudio.field_components.base import FieldModule
|
||||
from nerfstudio.utils.comments import print_tcnn_speed_warning
|
||||
from nerfstudio.field_components.base_field_component import FieldComponent
|
||||
from nerfstudio.utils.math import components_from_spherical_harmonics, expected_sin
|
||||
from nerfstudio.utils.printing import print_tcnn_speed_warning
|
||||
|
||||
try:
|
||||
import tinycudann as tcnn
|
||||
@@ -37,7 +37,7 @@ except ImportError:
|
||||
TCNN_EXISTS = False
|
||||
|
||||
|
||||
class Encoding(FieldModule):
|
||||
class Encoding(FieldComponent):
|
||||
"""Encode an input tensor. Intended to be subclassed
|
||||
|
||||
Args:
|
||||
@@ -21,7 +21,7 @@ from typing import Callable, Optional, Union
|
||||
from torch import nn
|
||||
from torchtyping import TensorType
|
||||
|
||||
from nerfstudio.field_components.base import FieldModule
|
||||
from nerfstudio.field_components.base_field_component import FieldComponent
|
||||
|
||||
|
||||
class FieldHeadNames(Enum):
|
||||
@@ -36,7 +36,7 @@ class FieldHeadNames(Enum):
|
||||
SEMANTICS = "semantics"
|
||||
|
||||
|
||||
class FieldHead(FieldModule):
|
||||
class FieldHead(FieldComponent):
|
||||
"""Base field output
|
||||
|
||||
Args:
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
# Copyright 2022 The Plenoptix Team. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
@@ -21,10 +21,10 @@ import torch
|
||||
from torch import nn
|
||||
from torchtyping import TensorType
|
||||
|
||||
from nerfstudio.field_components.base import FieldModule
|
||||
from nerfstudio.field_components.base_field_component import FieldComponent
|
||||
|
||||
|
||||
class MLP(FieldModule):
|
||||
class MLP(FieldComponent):
|
||||
"""Multilayer perceptron
|
||||
|
||||
Args:
|
||||
|
||||
Reference in new issue
Block a user