-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.py
95 lines (87 loc) · 4.6 KB
/
default.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
from copy import deepcopy
expname = None # experiment name
basedir = './logs/' # where to store ckpts and logs
''' Template of data options
'''
data = dict(
datadir=None, # path to dataset root folder
dataset_type=None, # blender | nsvf | blendedmvs | tankstemple | deepvoxels | co3d
inverse_y=False, # intrinsict mode (to support blendedmvs, nsvf, tankstemple)
flip_x=False, # to support co3d
flip_y=False, # to support co3d
annot_path='', # to support co3d
split_path='', # to support co3d
sequence_name='', # to support co3d
load2gpu_on_the_fly=False, # do not load all images into gpu (to save gpu memory)
testskip=1, # subsample testset to preview results
white_bkgd=False, # use white background (note that some dataset don't provide alpha and with blended bg color)
half_res=False, # [TODO]
factor=4, # [TODO]
# Below are forward-facing llff specific settings. Not support yet.
ndc=False, # use ndc coordinate (only for forward-facing; not support yet)
spherify=False, # inward-facing
llffhold=8, # testsplit
load_depths=False, # load depth
)
''' Template of training options
'''
coarse_train = dict(
N_iters=10000, # number of optimization steps
N_rand=8192, # batch size (number of random rays per optimization step)
lrate_density=1e-1, # lr of density voxel grid
lrate_k0=1e-1, # lr of color/feature voxel grid
lrate_rgbnet=1e-3, # lr of the mlp to preduct view-dependent color
lrate_decay=20, # lr decay by 0.1 after every lrate_decay*1000 steps
pervoxel_lr=True, # view-count-based lr
pervoxel_lr_downrate=1, # downsampled image for computing view-count-based lr
ray_sampler='random', # ray sampling strategies
weight_main=1.0, # weight of photometric loss
weight_entropy_last=0.01, # weight of background entropy loss
weight_rgbper=0.1, # weight of per-point rgb loss
tv_every=1, # count total variation loss every tv_every step
tv_from=0, # count total variation loss from tv_from step
weight_tv_density=0.0, # weight of total variation loss of density voxel grid
weight_tv_k0=0.0, # weight of total variation loss of color/feature voxel grid
pg_scale=[], # checkpoints for progressive scaling
)
fine_train = deepcopy(coarse_train)
fine_train.update(dict(
N_iters=20000,
pervoxel_lr=False,
ray_sampler='in_maskcache',
weight_entropy_last=0.001,
weight_rgbper=0.01,
pg_scale=[1000, 2000, 3000],
))
''' Template of model and rendering options
'''
coarse_model_and_render = dict(
num_voxels=1024000, # expected number of voxel
num_voxels_base=1024000, # to rescale delta distance
nearest=False, # nearest interpolation
pre_act_density=False, # pre-activated trilinear interpolation
in_act_density=False, # in-activated trilinear interpolation
bbox_thres=1e-3, # threshold to determine known free-space in the fine stage
mask_cache_thres=1e-3, # threshold to determine a tighten BBox in the fine stage
rgbnet_dim=0, # feature voxel grid dim
rgbnet_full_implicit=False, # let the colors MLP ignore feature voxel grid
rgbnet_direct=True, # set to False to treat the first 3 dim of feature voxel grid as diffuse rgb
rgbnet_depth=3, # depth of the colors MLP (there are rgbnet_depth-1 intermediate features)
rgbnet_width=128, # width of the colors MLP
alpha_init=1e-6, # set the alpha values everywhere at the begin of training
fast_color_thres=0, # threshold of alpha value to skip the fine stage sampled point
maskout_near_cam_vox=True, # maskout grid points that between cameras and their near planes
world_bound_scale=1, # rescale the BBox enclosing the scene
stepsize=0.5, # sampling stepsize in volume rendering
)
fine_model_and_render = deepcopy(coarse_model_and_render)
fine_model_and_render.update(dict(
num_voxels=160**3,
num_voxels_base=160**3,
rgbnet_dim=12,
alpha_init=1e-2,
fast_color_thres=1e-4,
maskout_near_cam_vox=False,
world_bound_scale=1.05,
))
del deepcopy