-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNetworkParameters.py
92 lines (91 loc) · 11 KB
/
NetworkParameters.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
import tensorflow as tf
weights = {
# rgb spatial context encoder
'conv0': tf.get_variable('conv0', shape=([3, 3, 3, 16]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv1_res1_1_base': tf.get_variable('conv1_res1_1_base', shape=([3, 3, 16, 16]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv1_res1_2_base': tf.get_variable('conv1_res1_2_base', shape=([3, 3, 16, 16]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv1_res2_1_base': tf.get_variable('conv1_res2_1_base', shape=([3, 3, 16, 16]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv1_res2_2_base': tf.get_variable('conv1_res2_2_base', shape=([3, 3, 16, 16]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv1_res3_1_base': tf.get_variable('conv1_res3_1_base', shape=([3, 3, 16, 16]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv1_res3_2_base': tf.get_variable('conv1_res3_2_base', shape=([3, 3, 16, 16]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv1_res4_1_base': tf.get_variable('conv1_res4_1_base', shape=([3, 3, 16, 16]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv1_res4_2_base': tf.get_variable('conv1_res4_2_base', shape=([3, 3, 16, 16]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv1': tf.get_variable('conv1', shape=([3, 3, 16, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv1_res1_1': tf.get_variable('conv1_res1_1', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv1_res1_2': tf.get_variable('conv1_res1_2', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv1_res2_1': tf.get_variable('conv1_res2_1', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv1_res2_2': tf.get_variable('conv1_res2_2', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv1_res3_1': tf.get_variable('conv1_res3_1', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv1_res3_2': tf.get_variable('conv1_res3_2', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv1_res4_1': tf.get_variable('conv1_res4_1', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv1_res4_2': tf.get_variable('conv1_res4_2', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv2': tf.get_variable('conv2', shape=([3, 3, 32, 64]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv2_res1_1': tf.get_variable('conv2_res1_1', shape=([3, 3, 64, 64]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv2_res1_2': tf.get_variable('conv2_res1_2', shape=([3, 3, 64, 64]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv2_res2_1': tf.get_variable('conv2_res2_1', shape=([3, 3, 64, 64]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv2_res2_2': tf.get_variable('conv2_res2_2', shape=([3, 3, 64, 64]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv2_res3_1': tf.get_variable('conv2_res3_1', shape=([3, 3, 64, 64]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv2_res3_2': tf.get_variable('conv2_res3_2', shape=([3, 3, 64, 64]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv2_res4_1': tf.get_variable('conv2_res4_1', shape=([3, 3, 64, 64]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv2_res4_2': tf.get_variable('conv2_res4_2', shape=([3, 3, 64, 64]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv3': tf.get_variable('conv3', shape=([3, 3, 64, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv3_res1_1': tf.get_variable('conv3_res1_1', shape=([3, 3, 128, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv3_res1_2': tf.get_variable('conv3_res1_2', shape=([3, 3, 128, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv3_res2_1': tf.get_variable('conv3_res2_1', shape=([3, 3, 128, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv3_res2_2': tf.get_variable('conv3_res2_2', shape=([3, 3, 128, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv3_res3_1': tf.get_variable('conv3_res3_1', shape=([3, 3, 128, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv3_res3_2': tf.get_variable('conv3_res3_2', shape=([3, 3, 128, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv3_res4_1': tf.get_variable('conv3_res4_1', shape=([3, 3, 128, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv3_res4_2': tf.get_variable('conv3_res4_2', shape=([3, 3, 128, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv4': tf.get_variable('conv4', shape=([3, 3, 128, 256]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv4_res1_1': tf.get_variable('conv4_res1_1', shape=([3, 3, 256, 256]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv4_res1_2': tf.get_variable('conv4_res1_2', shape=([3, 3, 256, 256]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv4_res2_1': tf.get_variable('conv4_res2_1', shape=([3, 3, 256, 256]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv4_res2_2': tf.get_variable('conv4_res2_2', shape=([3, 3, 256, 256]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv4_res3_1': tf.get_variable('conv4_res3_1', shape=([3, 3, 256, 256]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv4_res3_2': tf.get_variable('conv4_res3_2', shape=([3, 3, 256, 256]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv4_res4_1': tf.get_variable('conv4_res4_1', shape=([3, 3, 256, 256]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv4_res4_2': tf.get_variable('conv4_res4_2', shape=([3, 3, 256, 256]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'conv5': tf.get_variable('conv5', shape=([3, 3, 256, 256]), initializer=tf.contrib.layers.variance_scaling_initializer()),
# decoder albedo & ambient
'deconv1_j': tf.get_variable('deconv1_j', shape=([3, 3, 256, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'deconv2_j': tf.get_variable('deconv2_j', shape=([3, 3, 256, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'deconv3_j': tf.get_variable('deconv3_j', shape=([3, 3, 192, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'deconv4_j': tf.get_variable('deconv4_j', shape=([3, 3, 160, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'albedo_j': tf.get_variable('albedo_j', shape=([3, 3, 128, 3]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'ambient': tf.get_variable('ambient', shape=([3, 3, 128, 1]), initializer=tf.contrib.layers.variance_scaling_initializer()),
# decoder albedo & shadow
'deconv1_k': tf.get_variable('deconv1_k', shape=([3, 3, 256, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'deconv2_k': tf.get_variable('deconv2_k', shape=([3, 3, 256, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'deconv3_k': tf.get_variable('deconv3_k', shape=([3, 3, 192, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'deconv4_k': tf.get_variable('deconv4_k', shape=([3, 3, 160, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'albedo_k': tf.get_variable('albedo_k', shape=([3, 3, 128, 3]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'shadow': tf.get_variable('shadow', shape=([3, 3, 128, 1]), initializer=tf.contrib.layers.variance_scaling_initializer()),
# decoder albedo & shading
'deconv1_p': tf.get_variable('deconv1_p', shape=([3, 3, 256, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'deconv2_p': tf.get_variable('deconv2_p', shape=([3, 3, 256, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'deconv3_p': tf.get_variable('deconv3_p', shape=([3, 3, 192, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'deconv4_p': tf.get_variable('deconv4_p', shape=([3, 3, 160, 128]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'albedo_p': tf.get_variable('albedo_p', shape=([3, 3, 128, 3]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'shading': tf.get_variable('shading', shape=([3, 3, 128, 1]), initializer=tf.contrib.layers.variance_scaling_initializer()),
# fusion
'fuse': tf.get_variable('fuse', shape=([1, 1, 9, 24]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'fuse_conv_1': tf.get_variable('fuse_conv_1', shape=([3, 3, 35, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'fuse_res1_1': tf.get_variable('fuse_res1_1', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'fuse_res1_2': tf.get_variable('fuse_res1_2', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'fuse_res2_1': tf.get_variable('fuse_res2_1', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'fuse_res2_2': tf.get_variable('fuse_res2_2', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'fuse_res3_1': tf.get_variable('fuse_res3_1', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'fuse_res3_2': tf.get_variable('fuse_res3_2', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'fuse_res4_1': tf.get_variable('fuse_res4_1', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'fuse_res4_2': tf.get_variable('fuse_res4_2', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'fuse_res5_1': tf.get_variable('fuse_res5_1', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'fuse_res5_2': tf.get_variable('fuse_res5_2', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'fuse_res6_1': tf.get_variable('fuse_res6_1', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'fuse_res6_2': tf.get_variable('fuse_res6_2', shape=([3, 3, 32, 32]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'albedo': tf.get_variable('albedo', shape=([3, 3, 32, 3]), initializer=tf.contrib.layers.variance_scaling_initializer()),
# attention
'bottleneck_attention_ambient': tf.get_variable('bottleneck_attention_ambient', shape=([5, 256, 256]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'bottleneck_attention_shadow': tf.get_variable('bottleneck_attention_shadow', shape=([5, 256, 256]), initializer=tf.contrib.layers.variance_scaling_initializer()),
'bottleneck_attention_shading': tf.get_variable('bottleneck_attention_shading', shape=([5, 256, 256]), initializer=tf.contrib.layers.variance_scaling_initializer())
}