Making some updates to notation, documentation

This commit is contained in:
Jake Austin committed 2022-07-24 16:49:19 -07:00
1 parent 3a78a9cb2e
commit 2fc2fe3817
2 files changed
+18 -16

No files matched your search

+14 -13
View File
@@ -85,8 +85,8 @@ def setup_dataset_eval(config: DataConfig, test_mode: bool, device: str) -> Tupl
return dataset_inputs_eval, dataloader_eval return dataset_inputs_eval, dataloader_eval
class AbstractDataloaderV2(nn.Module): class AbstractDataloader(nn.Module):
"""Second version of the dataloader class """Second version of the dataloader class (V2)
This version of the dataloader is designed to subsume both the train and eval dataloaders, This version of the dataloader is designed to subsume both the train and eval dataloaders,
especially since this may contain learnable parameters which need to be shared across the train especially since this may contain learnable parameters which need to be shared across the train
@@ -118,8 +118,8 @@ class AbstractDataloaderV2(nn.Module):
image_sampler (ImageSampler): image sampler image_sampler (ImageSampler): image sampler
pixel_sampler (PixelSampler): pixel sampler pixel_sampler (PixelSampler): pixel sampler
ray_generator (RayGenerator): ray generator ray_generator (RayGenerator): ray generator
is_train (bool): whether this is being used for training use_train (bool): whether this is being used for training
is_eval (bool): whether this is being used for evaluation use_eval (bool): whether this is being used for evaluation
@@ -136,22 +136,22 @@ class AbstractDataloaderV2(nn.Module):
image_sampler: ImageSampler, image_sampler: ImageSampler,
pixel_sampler: PixelSampler, pixel_sampler: PixelSampler,
ray_generator: RayGenerator, ray_generator: RayGenerator,
is_train: bool, use_train: bool,
is_eval: bool, use_eval: bool,
): ):
super().__init__() super().__init__()
self.image_sampler = image_sampler self.image_sampler = image_sampler
self.pixel_sampler = pixel_sampler self.pixel_sampler = pixel_sampler
self.iter_image_sampler = iter(self.image_sampler) self.iter_image_sampler = iter(self.image_sampler)
self.ray_generator = ray_generator self.ray_generator = ray_generator
self.is_train = is_train self.use_train = use_train
self.is_eval = is_eval self.use_eval = use_eval
self.train_count = 0 self.train_count = 0
self.eval_count = 0 self.eval_count = 0
assert is_train or is_eval assert use_train or use_eval
if is_train: if use_train:
self.setup_train() self.setup_train()
if is_eval: if use_eval:
self.setup_eval() self.setup_eval()
def iter_train(self) -> IterableWrapper: def iter_train(self) -> IterableWrapper:
@@ -181,8 +181,9 @@ class AbstractDataloaderV2(nn.Module):
"""Returns the next batch of data from the eval dataloader""" """Returns the next batch of data from the eval dataloader"""
class AbstractCachedDataloaderV2(AbstractDataloaderV2): class AbstractCachedDataloaderV2(AbstractDataloader):
"""Subclass of the new V2 dataloader that is used for when things fit in memory """Subclass of the new V2 dataloader that is used for when things fit in memory,
and will be cached in the dataloader itself.
Attributes: Attributes:
camera_to_world (torch.Tensor): camera to world transformation camera_to_world (torch.Tensor): camera to world transformation
+4 -3
View File
@@ -111,7 +111,7 @@ class DatasetInputs:
@dataclass @dataclass
class GenericDataContainer: class BaseDataContainer:
"""A container for data that is not specific to any dataset. It should be everything """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 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 need to subclass from this differently, since different Field modules will require different
@@ -122,5 +122,6 @@ class GenericDataContainer:
ground_truth_pixels (TensorType["num_pixels", 3]): The ground truth pixels for the image. ground_truth_pixels (TensorType["num_pixels", 3]): The ground truth pixels for the image.
""" """
rays: RayBundle rays: RayBundle # Raybundle and the cameras will be merged into one thing in a later PR
ground_truth_pixels: TensorType["num_pixels", 3] = None cameras: torch.tensor
ground_truth_pixels: Optional[TensorType["num_pixels", 3]] = None