-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
56 lines (48 loc) · 2.07 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import argparse
from configparser import ConfigParser
from nerf import NeRFRunner
CONF_DIR = "./conf/"
# -----------------------------------START OF EVERYTHING----------------------------------
if __name__ == "__main__":
parser = argparse.ArgumentParser(description = "NeRF argument parser.")
parser.add_argument("--conf", type = str, default = "lego")
args = parser.parse_args()
conf = ConfigParser()
conf.read(CONF_DIR + args.conf + ".ini")
gpu = int(conf.get(args.conf, "GPU"))
img_dir = conf.get(args.conf, "IMG_DIR")
results_path = conf.get(args.conf, "RESULTS_PATH")
ckpt_path = conf.get(args.conf, "CKPT_PATH")
low_res = int(conf.get(args.conf, "LOW_RES"))
total_iter = int(conf.get(args.conf, "TOTAL_ITER"))
batch_ray = int(conf.get(args.conf, "BATCH_RAY"))
learning = float(conf.get(args.conf, "LEARNING"))
lr_gamma = float(conf.get(args.conf, "LR_GAMMA"))
lr_milestone = list(conf.get(args.conf, "LR_MILESTONE"))
n_coarse = int(conf.get(args.conf, "N_COARSE"))
n_fine = int(conf.get(args.conf, "N_FINE"))
data_type = conf.get(args.conf, "DATA_TYPE")
step = int(conf.get(args.conf, "STEP"))
decay_end = float(conf.get(args.conf, "DECAY_END"))
sched = conf.get(args.conf, "SCHED")
continue_ = eval(conf.get(args.conf, "CONTINUE"))
run_nerf = NeRFRunner(
gpu = gpu,
img_dir = img_dir,
results_path = results_path,
ckpt_path = ckpt_path,
low_res = low_res,
total_iter = total_iter,
batch_ray = batch_ray,
learning = learning,
lr_gamma = lr_gamma,
lr_milestone = lr_milestone,
n_coarse = n_coarse,
n_fine = n_fine,
data_type = data_type,
step = step,
decay_end = decay_end,
sched = sched,
continue_ = continue_)
run_nerf.trainer()
run_nerf.display()