-
Notifications
You must be signed in to change notification settings - Fork 15
/
config.py
149 lines (135 loc) · 8.51 KB
/
config.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import configargparse
parser = configargparse.ArgumentParser()
def config_parser():
parser.add_argument('--config', is_config_file=True,
help='config file path')
parser.add_argument("--expname", type=str,
help='experiment name')
parser.add_argument("--basedir", type=str, default='./logs/',
help='where to store ckpts and logs')
# data set options
parser.add_argument("--datadir", type=str, default='../../scan/seven_floor/',
help='input data directory')
parser.add_argument("--styledir", type=str, default='./style/')
parser.add_argument("--decoder_pth_path", type=str, default='./pretrained/decoder.pth')
parser.add_argument("--vgg_pth_path", type=str, default='./pretrained/vgg_normalised.pth')
parser.add_argument("--vae_pth_path", type=str, default='./pretrained/vae.pth')
parser.add_argument("--dataset_type", type=str, default='llff')
parser.add_argument("--factor", type=float, default=1.,
help='factor to downsample images')
parser.add_argument("--gen_factor", type=float, default=0.2, # 5,
help='factor for interpolate trace when style training')
parser.add_argument("--valid_factor", type=float, default=0.05,
help='factor for interpolate trace when validating')
parser.add_argument("--no_ndc", action='store_true', help='No NDC for llff dataset.')
parser.add_argument("--white_bkgd", action='store_true', help='White Background for blender dataset.')
parser.add_argument("--half_res", action='store_true', help='Half resolution for linemod dataset.')
parser.add_argument("--num_workers", type=int, default=0, help='Number of workers for torch dataloader.')
parser.add_argument("--spherify", action='store_true', help='Spherify camera poses or not')
parser.add_argument("--store_rays", type=int, default=1,
help='factor to downsample images')
# training options
parser.add_argument("--use_viewdir", action='store_true',
help='use view direction as input.')
parser.add_argument("--sample_type", type=str, default='uniform',
help='Types of sampling: [uniform]')
parser.add_argument("--act_type", type=str, default='relu',
help='Types of activation: [relu, tanh, elu]')
parser.add_argument("--nerf_type", type=str, default='nerf',
help='Types of nerf: [nerf]')
parser.add_argument("--style_type", type=str, default='mlp',
help='Types of style module: [mlp]')
parser.add_argument("--latent_type", type=str, default='variational',
help='Types of latent module: [variational latent]')
parser.add_argument("--nerf_type_fine", type=str, default='nerf',
help='Types of fine nerf: [nerf]')
parser.add_argument("--sigma_noise_std", type=float, default=1e0,
help='std dev of noise added to regularize sigma output, 1e0 recommended')
parser.add_argument("--siren_sigma_mul", type=float, default=20.,
help='amplify positive sigma for siren')
parser.add_argument("--rgb_loss_lambda", type=float, default=1.,
help='Coefficient for style loss')
parser.add_argument("--rgb_loss_lambda_2d", type=float, default=10.,
help='Coefficient for style loss')
parser.add_argument("--style_loss_lambda", type=float, default=1.,
help='Coefficient for style loss')
parser.add_argument("--content_loss_lambda", type=float, default=1.,
help='Coefficient for style loss')
parser.add_argument("--logp_loss_lambda", type=float, default=0.1,
help='Coefficient for logp loss')
parser.add_argument("--logp_loss_decay", type=float, default=1.,
help='Decay rate for logp loss per 1000 steps')
parser.add_argument("--lambda_u", type=float, default=0.01,
help='Nerf in the wild lambda u hyper parameter')
# Network
parser.add_argument("--netdepth", type=int, default=8,
help='layers in network')
parser.add_argument("--netwidth", type=int, default=256,
help='channels per layer')
parser.add_argument("--netdepth_fine", type=int, default=8,
help='layers in network')
parser.add_argument("--netwidth_fine", type=int, default=256,
help='channels per layer')
parser.add_argument("--style_D", type=int, default=8,
help='style layers in network')
parser.add_argument("--style_feature_dim", type=int, default=1024,
help='style feature dimension')
# VAE
parser.add_argument('--vae_d', type=int, default=4)
parser.add_argument('--vae_w', type=int, default=512)
parser.add_argument('--vae_latent', type=int, default=32)
parser.add_argument('--vae_kl_lambda', type=float, default=0.1)
parser.add_argument("--embed_freq_coor", type=int, default=10,
help='frequency of coordinate embedding')
parser.add_argument("--embed_freq_dir", type=int, default=4,
help='frequency of direction embedding')
parser.add_argument("--batch_size", type=int, default=2048,
help='batch size (number of random rays per gradient step)')
parser.add_argument("--batch_size_style", type=int, default=1024,
help='batch size (number of random rays per gradient step)')
parser.add_argument("--lrate", type=float, default=5e-4,
help='learning rate')
parser.add_argument("--lrate_decay", type=int, default=100000,
help='exponential learning rate decay (in 1000 steps)')
parser.add_argument("--chunk", type=int, default=1024*32,
help='number of rays processed in parallel, decrease if running out of memory')
parser.add_argument("--no_reload", action='store_true',
help='do not reload weights from saved ckpt')
parser.add_argument("--total_step", type=int, default=50000001,
help='total training step')
parser.add_argument("--origin_step", type=int, default=250000,
help='total training step')
parser.add_argument("--decoder_step", type=int, default=3500000,
help='total training step')
parser.add_argument("--steps_per_opt", type=int, default=1,
help='Steps for gradient accumulation')
parser.add_argument("--steps_patch", type=int, default=-1,
help='Steps interval for patch sampling')
parser.add_argument("--N_samples", type=int, default=64,
help='The number of sampling points per ray')
parser.add_argument("--N_samples_fine", type=int, default=64,
help='The number of sampling points per ray for fine network')
# logging/saving options
parser.add_argument("--i_print", type=int, default=100,
help='frequency of console printout and metric loggin')
parser.add_argument("--i_weights", type=int, default=5000,
help='frequency of weight ckpt saving')
parser.add_argument("--i_video", type=int, default=50000*100,
help='frequency of render_poses video saving')
parser.add_argument("--ckp_num", type=int, default=3,
help='Max number of saved ckpts.')
parser.add_argument("--render_valid", action='store_true',
help='render valid')
parser.add_argument("--render_train", action='store_true',
help='render train')
parser.add_argument("--render_valid_style", action='store_true',
help='render valid style')
parser.add_argument("--render_train_style", action='store_true',
help='render train style')
parser.add_argument("--sigma_scale", type=float, default=1.)
# Pixel Alignment
parser.add_argument("--pixel_alignment", action='store_true',
help='Pixel Alignment with half a pixel.')
parser.add_argument("--TT_far", type=float, default=8., help='Far value of TT dataset NeRF')
args = parser.parse_args()
return args