| 29 | |
| 30 | @dataclass |
| 31 | class Options: |
| 32 | config: str |
| 33 | experiment_name: str |
| 34 | logging_root: str |
| 35 | dataset_path: str |
| 36 | num_epochs: int |
| 37 | epochs_til_ckpt: int |
| 38 | steps_til_summary: int |
| 39 | gpu: int |
| 40 | img_size: int |
| 41 | chunk_size_train: int |
| 42 | chunk_size_eval: int |
| 43 | num_workers: int |
| 44 | lr: float |
| 45 | batch_size: int |
| 46 | hidden_features: int |
| 47 | hidden_layers: int |
| 48 | model: str |
| 49 | activation: str |
| 50 | multiscale: bool |
| 51 | single_network: bool |
| 52 | use_resized: bool |
| 53 | reuse_filters: bool |
| 54 | samples_per_ray: int |
| 55 | samples_per_view: int |
| 56 | forward_mode: str |
| 57 | supervise_hr: bool |
| 58 | rank: int |
| 59 | |
| 60 | def __init__(self, **kwargs): |
| 61 | names = set([f.name for f in dataclasses.fields(self)]) |
| 62 | for k, v in kwargs.items(): |
| 63 | if k in names: |
| 64 | setattr(self, k, self.__annotations__[k](v)) |
| 65 | |
| 66 | if 'supervise_hr' not in kwargs.keys(): |
| 67 | self.supervise_hr = False |
| 68 | |
| 69 | self.img_size = 512 |
| 70 | |
| 71 | |
| 72 | def load_dataset(opt, res, scale): |