-
Notifications
You must be signed in to change notification settings - Fork 141
/
config_matterport.lua
executable file
·80 lines (67 loc) · 3.19 KB
/
config_matterport.lua
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
require "utils"
--- All parameters goes here
local config = config or {}
function config.parse(arg)
local cmd = torch.CmdLine()
cmd:text()
cmd:text('Multi-Task Classification FCN')
cmd:text()
-- Parameters
-- model configuration
cmd:option('-model', 'model_deep.lua', 'model file')
cmd:option('-model_nobn', 'model_deep_new.lua', 'model file without the last bn layer')
cmd:option('-input_channel', 3, '# of input channels')
cmd:option('-output_channel', 3, '# of output channels')
-- testing
cmd:option('-test_model', '', 'model used for testing')
cmd:option('-result_path', './result/', 'path to save result')
cmd:option('-max_count', 1000000, 'max number of data to test')
-- data loader
cmd:option('-root_path', '/n/fs/rgbd/data/matterport/v1/', 'path to the root of the dataset')
cmd:option('-train_file', './data_list/train_list_noup.txt', 'train file, compulsory')
cmd:option('-test_file', './data_list/test_list_horizontal_small.txt', 'test file, compulsory')
-- training and testing
cmd:option('-gpuid', 1, 'gpu id')
cmd:option('-optim_state', {rho=0.95, eps=1e-6, learningRate=1e-3, learningRateMin=1e-7, momentum=0.9}, 'optim state')
cmd:option('-lr_decay', 150000, 'iterations between lr decreses')
cmd:option('-lr_decay_t', 5, 'lr decay times')
cmd:option('-nb_epoch', 20, 'number of epoches')
cmd:option('-batch_size', 1, 'batch size')
cmd:option('-pixel_means', {128, 128, 128}, 'Pixel mean values (RGB order)')
-- CVPR 2018 training option
cmd:option('-use_render_normal_gt', false, 'use normal ground truth from rendering')
cmd:option('-mix', false, 'use both color and depth as input')
cmd:option('-train_mask', 1, '1: use all, 2: use unobserved, 3: use observed, 4: use unobserved + subset of observed')
cmd:option('-random_ratio', 0, 'the ratio of pixel to hide from training')
-- resume
cmd:option('-resume_training', false, 'whether resume training')
cmd:option('-saved_model_weights', '', 'path to saved model weights')
cmd:option('-saved_optim_state', '', 'path to saved model weights')
-- finetune
-- cmd:option('-finetune', false, '')
cmd:option('-finetune_model', '../pre_train_model/sync_mp.t7', '')
cmd:option('-finetune_init_lr', 1e-4, '')
-- save/print/log
cmd:option('-snapshot_iters', 50000, 'Iterations between snapshots (used for saving the network)')
cmd:option('-print_iters', 20, 'Iterations between print')
cmd:option('-log_iters', 20, 'Iterations between log')
cmd:option('-log_path','./logs/','Path to be used for logging')
cmd:option('-ps', '', 'prefix: path&name to model and snapshot')
cmd:option('-verbose', false, 'show more message')
-- Parsing the command line
config = cmd:parse(arg or {})
config.colors = {{0, 0, 0}, -- black
{1, 0, 0}, -- red
{0, 1, 0}, -- green
{0, 0, 1}, -- blue
{1, 1, 0}, -- yellow
{1, 0, 1}, -- magenta
{0, 1, 1}, -- cyan
{1, 1, 1} -- white
}
if config.mix then
config.input_channel = 5
end
return config
end
return config