cleanup
This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-09-01 12:36:54 -07:00
1 parent 9b0cf2ab16
commit f910836b8c
13 files changed
+99 -95

No files matched your search

-40
View File
@@ -24,7 +24,6 @@ import torch
from torchtyping import TensorType
from nerfactory.cameras.cameras import Cameras
from nerfactory.cameras.rays import RayBundle
@dataclass
@@ -133,42 +132,3 @@ class DatasetInputs:
def as_dict(self) -> dict:
"""Returns the dataclass as a dictionary."""
return vars(self)
@dataclass
class DataloaderOutputs:
"""A container for data that is not specific to any dataset. It should be everything
needed by the renderer and loss calculation. Different datasets and models will probably
need to subclass from this differently, since different Field modules will require different
data.
Args:
rays (RayBundle): The rays for the image.
ground_truth_pixels (TensorType["num_pixels", 3]): The ground truth pixels for the image.
"""
rays: RayBundle # Raybundle and the cameras will be merged into one thing in a later PR
cameras: torch.Tensor
ground_truth_pixels: Optional[TensorType["num_pixels", 3]] = None
def check_inputs(self, expected_attr: Dict):
"""This will check to make sure that the expected attributes exist.
This will exist in any subclassed version of this"""
for attr in expected_attr:
assert hasattr(self, attr)
@dataclass
class ModelOutputs:
"""A container for outputs from the model.
This will be passed into the loss function along with the base data container. It should be
subclassed for when your model outputs different things.
Args:
rays (RayBundle): The rays for the image.
ground_truth_pixels (TensorType["num_pixels", 3]): The ground truth pixels for the image.
"""
rendered_pixels: Optional[TensorType["num_pixels", 3]] = None