mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-07 00:09:14 +08:00
fixed most linting errors
This commit is contained in:
1 parent
a7167f890e
commit
5691d00d42
14 files changed
+110
-45
No files matched your search
@@ -1,6 +1,12 @@
|
||||
"""
|
||||
The dataset baseclass.
|
||||
"""
|
||||
|
||||
from abc import abstractmethod
|
||||
import torch
|
||||
|
||||
from mattport.nerf.cameras import Camera
|
||||
|
||||
|
||||
class Dataset(torch.utils.data.Dataset):
|
||||
"""_summary_
|
||||
@@ -12,20 +18,51 @@ class Dataset(torch.utils.data.Dataset):
|
||||
def __init__(
|
||||
self,
|
||||
data_directory: str,
|
||||
) -> None:
|
||||
dataset_type: str,
|
||||
scene: str
|
||||
):
|
||||
"""_summary_
|
||||
|
||||
Args:
|
||||
data_directory (str): _description_
|
||||
type (str): _description_
|
||||
scene (str): _description_
|
||||
"""
|
||||
super().__init__()
|
||||
pass
|
||||
self.data_directory = data_directory
|
||||
self.dataset_type = dataset_type
|
||||
self.scene = scene
|
||||
|
||||
|
||||
def __len__(self):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_image(self, idx):
|
||||
pass
|
||||
"""_summary_
|
||||
|
||||
Args:
|
||||
idx (_type_): _description_
|
||||
|
||||
Raises:
|
||||
NotImplementedError: _description_
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
def get_pose(self, idx):
|
||||
pass
|
||||
def get_camera(self, idx) -> Camera:
|
||||
"""_summary_
|
||||
|
||||
Args:
|
||||
idx (_type_): _description_
|
||||
|
||||
Raises:
|
||||
NotImplementedError: _description_
|
||||
|
||||
Returns:
|
||||
Camera: _description_
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def __getitem__(self, idx):
|
||||
raise NotImplementedError
|
||||
@@ -1,8 +1,12 @@
|
||||
from argon2 import DEFAULT_RANDOM_SALT_LENGTH
|
||||
from mattport.nerf.dataset.base import Dataset
|
||||
"""
|
||||
Builds the dataset
|
||||
"""
|
||||
import importlib
|
||||
import logging
|
||||
|
||||
from mattport.nerf.dataset.base import Dataset
|
||||
|
||||
|
||||
def build_dataset(config: dict) -> Dataset:
|
||||
"""Returns the dataset according to the specified config.
|
||||
# TODO(ethan): change the type from dict to be a dataclass
|
||||
@@ -11,7 +15,12 @@ def build_dataset(config: dict) -> Dataset:
|
||||
config (dict): _description_
|
||||
"""
|
||||
|
||||
# TODO(ethan): better handle this with configs
|
||||
module = importlib.import_module("mattport.nerf.dataset.base")
|
||||
dataset = module.Dataset(**config)
|
||||
dataset = module.Dataset(
|
||||
data_directory=config.data_directory,
|
||||
dataset_type=config.dataset_type,
|
||||
scene=config.scene,
|
||||
)
|
||||
logging.info(dataset)
|
||||
return dataset
|
||||
return dataset
|
||||
Reference in new issue
Block a user