-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
252 lines (205 loc) · 10.3 KB
/
Makefile
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# -------------------------------------------
inspect:
python bin/inspect_model.py output/simple_kp_bayer_large data/real_mosaic/bayer output/kernel_viz --offset_x 1 --offset_y 0 \
--shift_x 1024 --shift_y 1024
inspect_xtrans:
python bin/inspect_model.py output/simple_kp_xtrans data/real_mosaic/xtrans output/kernel_viz_xtrans --offset_x 0 --offset_y 0 \
inspect_data:
python bin/view_data.py data/images/test/filelist.txt --xtrans
# -------------------------------------------
analysis:
python bin/analysis.py data/images/test/filelist.txt --offset_x 1 --ksize 5
# -------------------------------------------
eval_bayer_kpae:
python bin/eval.py output/kpae_bayer_l2 data/real_mosaic/bayer output/eval/bayer --offset_x 1 \
--pretrained pretrained_models/bayer
eval_bayer_kp:
python bin/eval.py output/kp_bayer data/real_mosaic/bayer output/eval/bayer --offset_x 1 \
--pretrained pretrained_models/bayer
eval_bayer_nn:
python bin/eval.py output/nn data/real_mosaic/bayer output/eval/bayer --offset_x 1 \
--pretrained pretrained_models/bayer
eval_xtrans:
python bin/eval.py output/simple_kp_xtrans data/real_mosaic/xtrans output/eval/simple_kp_xtrans \
--pretrained pretrained_models/xtrans --xtrans
# -- Train ------------------------------------
# 2018-07-12
train_ti_l2_k3:
CUDA_VISIBLE_DEVICES=1 python bin/train.py data/images/tiles32/filelist.txt \
output/bayer_ti_l2_k3 \
--params model=TranslationInvariant period=2 ksize=3 \
--loss l2 --green_only \
--val_data data/images/val/filelist_vdp_short.txt --pretrained pretrained_models/bayer \
--batch_size 32 --lr 1e-4
train_ti_l1_k3:
CUDA_VISIBLE_DEVICES=1 python bin/train.py data/images/tiles32/filelist.txt \
output/bayer_ti_l1_k3 \
--params model=TranslationInvariant period=2 ksize=3 \
--loss l1 --green_only \
--val_data data/images/val/filelist_vdp_short.txt --pretrained pretrained_models/bayer \
--batch_size 32 --lr 1e-4
train_ti_l2_k5:
CUDA_VISIBLE_DEVICES=0 python bin/train.py data/images/tiles32/filelist.txt \
output/bayer_ti_l2_k5 \
--params model=TranslationInvariant period=2 ksize=5 \
--loss l2 --green_only \
--val_data data/images/val/filelist_vdp_short.txt --pretrained pretrained_models/bayer \
--batch_size 32 --lr 1e-4
train_ti_l1_k5:
CUDA_VISIBLE_DEVICES=0 python bin/train.py data/images/tiles32/filelist.txt \
output/bayer_ti_l1_k5 \
--params model=TranslationInvariant period=2 ksize=5 \
--loss l1 --green_only \
--val_data data/images/val/filelist_vdp_short.txt --pretrained pretrained_models/bayer \
--batch_size 32 --lr 1e-4
train_ti_gl_k3:
CUDA_VISIBLE_DEVICES=0 python bin/train.py data/images/tiles32/filelist.txt \
output/bayer_ti_gl_k3 \
--params model=TranslationInvariant period=2 ksize=3 \
--loss laplacian --green_only --optimizer sgd \
--val_data data/images/val/filelist_vdp_short.txt --pretrained pretrained_models/bayer \
--batch_size 32 --lr 1e-3
train_ti_gl_k5:
CUDA_VISIBLE_DEVICES=1 python bin/train.py data/images/tiles32/filelist.txt \
output/bayer_ti_gl_k5 \
--params model=TranslationInvariant period=2 ksize=5 \
--loss laplacian --green_only --optimizer sgd \
--val_data data/images/val/filelist_vdp_short.txt --pretrained pretrained_models/bayer \
--batch_size 32 --lr 1e-3
train_eg:
CUDA_VISIBLE_DEVICES=1 python bin/train.py data/images/tiles32/filelist.txt \
output/bayer_eg \
--params model=EdgeGreen period=2 ksize=3 \
--loss gradient --green_only --optimizer adam \
--val_data data/images/val/filelist_vdp_short.txt --pretrained pretrained_models/bayer \
--batch_size 32 --lr 1e-4
# previous --------------------------------------
train_simple_kp_bayer:
python bin/train.py data/images/train/filelist.txt output/simple_kp_bayer \
--params model=SimpleKP mosaic_period=2 --loss l2\
--pretrained pretrained_models/bayer \
--val_data data/images/val/filelist.txt --batch_size 4 --lr 1e-5
train_simple_kp_bayer_large:
CUDA_VISIBLE_DEVICES=1 python bin/train.py data/images/train/filelist.txt output/simple_kp_bayer_large \
--params model=SimpleKP mosaic_period=2 ksize=11 levels=5 --loss l2 \
--pretrained pretrained_models/bayer \
--val_data data/images/val/filelist.txt --batch_size 4 --lr 1e-5
train_simple_kp_xtrans:
CUDA_VISIBLE_DEVICES=1 python bin/train.py data/images/train/filelist.txt output/simple_kp_xtrans \
--params model=SimpleKP mosaic_period=6 --loss l2 \
--pretrained pretrained_models/xtrans --xtrans \
--val_data data/images/val/filelist.txt --batch_size 4 --lr 1e-5
train_simple_kp_xtrans_no_norm:
CUDA_VISIBLE_DEVICES=0 python bin/train.py data/images/train/filelist.txt output/simple_kp_xtrans_no_norm \
--params model=SimpleKP mosaic_period=6 normalize=False --loss l2 \
--pretrained pretrained_models/xtrans --xtrans \
--val_data data/images/val/filelist.txt --batch_size 4 --lr 1e-4
train_simple_kp_xtrans_large_go:
CUDA_VISIBLE_DEVICES=1 python bin/train.py data/images/train/filelist.txt output/simple_kp_xtrans_large_go \
--params model=SimpleKP mosaic_period=6 convs=2 ksize=15 width=64 activation=relu --loss l2 \
--pretrained pretrained_models/xtrans --xtrans --green_only --subsample\
--val_data data/images/val/filelist.txt --batch_size 1 --lr 1e-4
train_idkp_xtrans_go:
CUDA_VISIBLE_DEVICES=1 python bin/train.py data/images/train/filelist.txt output/idkp_xtrans_go \
--params model=IndependentKP period=6 --loss l2 \
--pretrained pretrained_models/xtrans --xtrans --green_only \
--val_data data/images/val/filelist.txt --batch_size 1 --lr 1e-4
train_idkp_bayer_go:
CUDA_VISIBLE_DEVICES=0 python bin/train.py data/images/train/filelist.txt output/idkp_bayer_go \
--params model=IndependentKP period=2 --loss l2 \
--pretrained pretrained_models/bayer --green_only \
--val_data data/images/val/filelist.txt --batch_size 1 --lr 1e-4
train_ck_bayer_go:
CUDA_VISIBLE_DEVICES=0 python bin/train.py data/images/train/filelist.txt output/ck_bayer_go \
--params model=ClassifierKernels period=2 --loss l2 \
--pretrained pretrained_models/bayer --green_only --subsample \
--val_data data/images/val/filelist.txt --batch_size 1 --lr 1e-4
train_tick_bayer_go:
CUDA_VISIBLE_DEVICES=0 python bin/train.py data/images/train/filelist.txt output/tick_bayer_go \
--params model=TranslationInvariantClassifierKernels period=2 --loss l2 \
--pretrained pretrained_models/bayer --green_only \
--val_data data/images/val/filelist.txt --batch_size 16 --lr 1e-4
train_neighborhood:
CUDA_VISIBLE_DEVICES=1 python bin/train.py data/images/train/filelist.txt output/neighborhood \
--params model=NeighborhoodNet width=128 period=2 --loss l2 \
--pretrained pretrained_models/bayer --green_only \
--val_data data/images/val/filelist.txt --batch_size 1 --lr 1e-4
train_vgg_neighborhood:
CUDA_VISIBLE_DEVICES=1 python bin/train.py data/images/train/filelist.txt output/vgg_neighborhood \
--params model=NeighborhoodNet width=128 period=2 --loss vgg \
--pretrained pretrained_models/bayer --green_only \
--val_data data/images/val/filelist.txt --batch_size 1 --lr 1e-4
train_big_neighborhood:
CUDA_VISIBLE_DEVICES=0 python bin/train.py data/images/train/filelist.txt output/big_neighborhood \
--params model=NeighborhoodNet ksize=5 period=2 --loss l2\
--pretrained pretrained_models/bayer --green_only \
--val_data data/images/val/filelist.txt --batch_size 1 --lr 1e-4
train_bigger_neighborhood:
CUDA_VISIBLE_DEVICES=0 python bin/train.py data/images/train/filelist.txt output/bigger_neighborhood \
--params model=NeighborhoodNet ksize=7 width=32 period=2 --loss l2\
--pretrained pretrained_models/bayer --green_only \
--val_data data/images/val/filelist.txt --batch_size 1 --lr 1e-4
train_bigger_ck_bayer_go:
CUDA_VISIBLE_DEVICES=1 python bin/train.py data/images/train/filelist.txt output/bigger_ck_bayer_go \
--params model=ClassifierKernels period=2 ksize=5 --loss l2 \
--pretrained pretrained_models/bayer --green_only --subsample \
--val_data data/images/val/filelist.txt --batch_size 1 --lr 1e-4
train_demo:
python bin/train.py demo_data/filelist.txt output/bayer \
--pretrained pretrained_models/bayer \
--val_data demo_data/filelist.txt --batch_size 1
train_bayer:
python bin/train.py data/images/train/filelist.txt output/bayer_ref \
--pretrained pretrained_models/bayer \
--val_data data/images/train/filelist.txt --batch_size 1
train_exp:
python bin/train.py data/images/train/filelist.txt output/exp \
--params model=BayerExperimental \
--val_data data/images/val/filelist.txt --batch_size 32
train_nn:
python bin/train.py data/images/train/filelist.txt output/nn \
--params model=BayerNN \
--val_data data/images/val/filelist.txt --batch_size 128 --lr 1e-5
train_nn_unnormalized:
python bin/train.py data/images/train/filelist.txt output/nn_unnormalized \
--params model=BayerNN normalize=False\
--val_data data/images/val/filelist.txt --batch_size 64 --lr 1e-4
train_log:
python bin/train.py data/images/train/filelist.txt output/log \
--params model=BayerLog --loss vgg \
--val_data data/images/val/filelist.txt --batch_size 4 --lr 1e-4
train_kp_bayer:
python bin/train.py data/images/train/filelist.txt output/kp_bayer \
--params model=BayerKP --loss vgg \
--pretrained pretrained_models/bayer \
--val_data data/images/val/filelist.txt --batch_size 4 --lr 1e-4
train_kpae_bayer:
python bin/train.py data/images/train/filelist.txt output/kpae_bayer \
--params model=BayerKP autoencoder=True --loss vgg \
--pretrained pretrained_models/bayer \
--val_data data/images/val/filelist.txt --batch_size 4 --lr 1e-5
train_kpae_bayer_l2:
python bin/train.py data/images/train/filelist.txt output/kpae_bayer_l2 \
--params model=BayerKP autoencoder=True --loss l2 \
--pretrained pretrained_models/bayer \
--val_data data/images/val/filelist.txt --batch_size 16 --lr 1e-5
train_kpae_bayer_small:
python bin/train.py data/images/train/filelist.txt output/kpae_bayer_small \
--params model=BayerKP autoencoder=True convs=1 levels=3 width=32 ksize=5 --loss l2 \
--pretrained pretrained_models/bayer \
--val_data data/images/val/filelist.txt --batch_size 16 --lr 1e-5
# train_bayer:
# echo "nothing yet"
setup: build download_data
build:
pip install -r requirements.txt
git submodule init
git submodule update
# Launch a server to visualize training (port 8097)
server:
python -m 'visdom.server'
download_data: data
cd data && wget https://data.csail.mit.edu/graphics/demosaicnet/download_dataset.py && \
python download_dataset.py
data:
mkdir - p data