-
Notifications
You must be signed in to change notification settings - Fork 13
/
opt.py
57 lines (52 loc) · 2.75 KB
/
opt.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
57
import configargparse
def config_parser(cmd=None):
parser = configargparse.ArgumentParser()
# experiment
parser.add_argument('--load-image', type=str, default=None,
help='zero123pp image path')
parser.add_argument("--proj-name", type=str, default="test",
help='experiment name')
parser.add_argument("--wandb-project", type=str,
default="zerorf", help='wandb project name')
# data
parser.add_argument("--dataset", type=str,
default="nerf_syn", help='type of dataset')
parser.add_argument("--data-dir", type=str,
default="/root/nerf_synthetic", help='directory of the dataset')
parser.add_argument("--obj", type=str,
default="chair", help='object name')
parser.add_argument("--n-views", type=int,
default=6, help='number of input views')
# model
parser.add_argument("--model-res", type=int,
default=20, help='noise resolution (should be about 1/40 the provided image resolution), ignored when load-image is set')
parser.add_argument("--model-ch", type=int,
default=8, help='noise channel')
parser.add_argument("--n-rays-init", type=int,
default=2**12, help='number of rays per batch initially')
parser.add_argument("--n-rays-up", type=int,
default=2**16, help='number of rays per batch after 100 iterations')
parser.add_argument("--learn-bg", action='store_true', help='if learn background')
parser.add_argument("--bg-color", type=float,
default=1.0, help='background color')
parser.add_argument("--rep", type=str, choices=['dif', 'tensorf'],
default="dif", help="representation to use")
# training
parser.add_argument("--net-lr", type=float,
default=0.002, help='learning rate')
parser.add_argument("--seed", type=int,
default=1337, help='random seed')
parser.add_argument("--n-val", type=int,
default=1, help='number of validate views')
parser.add_argument("--net-lr-decay-to", type=float,
default=0.002, help='lr decay rate')
parser.add_argument("--n-iters", type=int,
default=10000, help='number of iterations')
parser.add_argument("--val-iter", type=int,
default=1000, help='valid every k iterations')
parser.add_argument("--device", type=str,
default="cuda:0", help='device name')
if cmd is not None:
return parser.parse_args(cmd)
else:
return parser.parse_args()