-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
40 lines (26 loc) · 803 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import argparse
import torch
from train.trainer import Trainer
from util.config import load_config
from visualize import main as visualize_main
torch.set_float32_matmul_precision("high")
def add_arguments():
parser = argparse.ArgumentParser(description="nerf trainer")
parser.add_argument("--config", type=str)
parser.add_argument("--ckpt", type=str, default=None)
parser.add_argument(
"--visualize",
action="store_true",
)
return parser.parse_args()
def main(config, ckpt_path):
Trainer(
**config,
ckpt_path=ckpt_path,
).run()
if __name__ == "__main__":
args = add_arguments()
if args.visualize:
visualize_main(load_config(args.config), args.ckpt)
else:
main(load_config(args.config), args.ckpt)