mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-13 03:14:00 +08:00
* code to process the friends data. need to add masking * code to process the friends data. need to add masking * black * trying to fix black * black fixed * updating black version
43 lines
998 B
Python
43 lines
998 B
Python
"""
|
|
Dataset input structures.
|
|
"""
|
|
|
|
from dataclasses import dataclass
|
|
from typing import List, Optional
|
|
|
|
import torch
|
|
from torchtyping import TensorType
|
|
|
|
|
|
@dataclass
|
|
class PointCloud:
|
|
"""_summary_"""
|
|
|
|
xyz: None
|
|
rgb: None
|
|
|
|
|
|
@dataclass
|
|
class DatasetInputs:
|
|
"""Dataset inputs for the image dataset and the ray generator.
|
|
|
|
Args:
|
|
image_filenames: Filenames for the images.
|
|
...
|
|
"""
|
|
|
|
image_filenames: List[str]
|
|
downscale_factor: int = 1
|
|
intrinsics: torch.tensor = None
|
|
camera_to_world: torch.tensor = None
|
|
bounding_box: torch.tensor = None
|
|
depth_filenames: List[str] = None
|
|
semantic_filenames: List[str] = None
|
|
point_cloud: PointCloud = None # TODO(ethan): specify the type here
|
|
alpha_color: Optional[TensorType[3]] = None
|
|
|
|
def check_inputs(self):
|
|
"""Check the inputs to make sure everything is okay."""
|
|
assert self.intrinsics.dtype == torch.float32
|
|
assert self.camera_to_world.dtype == torch.float32
|