mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-24 18:14:16 +08:00
GenericDataContainer and AbstractDataloaderV2
This commit is contained in:
1 parent
971f503a9c
commit
1ef976d177
2 files changed
+114
-1
No files matched your search
@@ -20,6 +20,7 @@ from dataclasses import dataclass
|
||||
from typing import List, Optional
|
||||
|
||||
import torch
|
||||
from pyrad.cameras.rays import RayBundle
|
||||
from torchtyping import TensorType
|
||||
|
||||
|
||||
@@ -106,3 +107,19 @@ class DatasetInputs:
|
||||
def as_dict(self) -> dict:
|
||||
"""Returns the dataclass as a dictionary."""
|
||||
return vars(self)
|
||||
|
||||
|
||||
@dataclass
|
||||
class GenericDataContainer:
|
||||
"""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: The rays for the image.
|
||||
ground_truth_pixels: The ground truth pixels for the image.
|
||||
"""
|
||||
|
||||
rays: RayBundle
|
||||
ground_truth_pixels: TensorType["num_pixels", 3] = None
|
||||
Reference in new issue
Block a user