mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-06 15:59:16 +08:00
brainstorming trainer code but broken
This commit is contained in:
1 parent
a9c0d5b97f
commit
a7167f890e
9 files changed
+166
-31
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,31 @@
|
||||
from abc import abstractmethod
|
||||
import torch
|
||||
|
||||
|
||||
class Dataset(torch.utils.data.Dataset):
|
||||
"""_summary_
|
||||
|
||||
Args:
|
||||
torch (_type_): _description_
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
data_directory: str,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
pass
|
||||
|
||||
def __len__(self):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_image(self, idx):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_pose(self, idx):
|
||||
pass
|
||||
|
||||
def __getitem__(self, idx):
|
||||
raise NotImplementedError
|
||||
@@ -0,0 +1,17 @@
|
||||
from argon2 import DEFAULT_RANDOM_SALT_LENGTH
|
||||
from mattport.nerf.dataset.base import Dataset
|
||||
import importlib
|
||||
import logging
|
||||
|
||||
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
|
||||
|
||||
Args:
|
||||
config (dict): _description_
|
||||
"""
|
||||
|
||||
module = importlib.import_module("mattport.nerf.dataset.base")
|
||||
dataset = module.Dataset(**config)
|
||||
logging.info(dataset)
|
||||
return dataset
|
||||
Reference in new issue
Block a user