Datasets#
Base#
Dataset.
- class nerfstudio.data.datasets.base_dataset.InputDataset(dataparser_outputs: DataparserOutputs, scale_factor: float = 1.0, cache_compressed_images: bool = False)[source]#
- Dataset that returns images. - Parameters:
- dataparser_outputs – description of where and how to read input images. 
- scale_factor – The scaling factor for the dataparser outputs 
 
 - cache_compressed_images#
- If cache_compressed_images == True, cache all the image files into RAM in their compressed form (jpeg, png, etc. but not as pytorch tensors) 
 - get_data(image_idx: int, image_type: Literal['uint8', 'float32'] = 'float32') Dict[source]#
- Returns the ImageDataset data as a dictionary. - Parameters:
- image_idx – The image index in the dataset. 
- image_type – the type of images returned 
 
 
 - get_image_float32(image_idx: int) Float[Tensor, 'image_height image_width num_channels'][source]#
- Returns a 3 channel image in float32 torch.Tensor. - Parameters:
- image_idx – The image index in the dataset. 
 
 - get_image_uint8(image_idx: int) UInt8[Tensor, 'image_height image_width num_channels'][source]#
- Returns a 3 channel image in uint8 torch.Tensor. - Parameters:
- image_idx – The image index in the dataset. 
 
 - get_metadata(data: Dict) Dict[source]#
- Method that can be used to process any additional metadata that may be part of the model inputs. - Parameters:
- image_idx – The image index in the dataset. 
 
 - get_numpy_image(image_idx: int) ndarray[Any, dtype[uint8]][source]#
- Returns the image of shape (H, W, 3 or 4). - Parameters:
- image_idx – The image index in the dataset. 
 
 - property image_filenames: List[Path]#
- Returns image filenames for this dataset. The order of filenames is the same as in the Cameras object for easy mapping. 
 
SDF Dataset#
SDFStudio dataset.
- class nerfstudio.data.datasets.sdf_dataset.SDFDataset(dataparser_outputs: DataparserOutputs, scale_factor: float = 1.0)[source]#
- Bases: - InputDataset- Dataset that returns images and depths. - Parameters:
- dataparser_outputs – description of where and how to read input images. 
- scale_factor – The scaling factor for the dataparser outputs. 
 
 - get_depths_and_normals(depth_filepath: Path, normal_filename: Path, camtoworld: Tensor)[source]#
- function to process additional depths and normal information :param depth_filepath: path to depth file :param normal_filename: path to normal file :param camtoworld: camera to world transformation matrix 
 
Semantic Dataset#
Semantic dataset.
- class nerfstudio.data.datasets.semantic_dataset.SemanticDataset(dataparser_outputs: DataparserOutputs, scale_factor: float = 1.0)[source]#
- Bases: - InputDataset- Dataset that returns images and semantics and masks. - Parameters:
- dataparser_outputs – description of where and how to read input images.