-
Notifications
You must be signed in to change notification settings - Fork 1
/
cpm.py
286 lines (282 loc) · 19.6 KB
/
cpm.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
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
import tensorflow as tf
import tensorflow.contrib.layers as layers
def inference_person(image):
with tf.variable_scope('PersonNet'):
conv1_1 = layers.conv2d(image, 64, 3, 1, activation_fn=None, scope='conv1_1')
conv1_1 = tf.nn.relu(conv1_1)
conv1_2 = layers.conv2d(conv1_1, 64, 3, 1, activation_fn=None, scope='conv1_2')
conv1_2 = tf.nn.relu(conv1_2)
pool1_stage1 = layers.max_pool2d(conv1_2, 2, 2)
conv2_1 = layers.conv2d(pool1_stage1, 128, 3, 1, activation_fn=None, scope='conv2_1')
conv2_1 = tf.nn.relu(conv2_1)
conv2_2 = layers.conv2d(conv2_1, 128, 3, 1, activation_fn=None, scope='conv2_2')
conv2_2 = tf.nn.relu(conv2_2)
pool2_stage1 = layers.max_pool2d(conv2_2, 2, 2)
conv3_1 = layers.conv2d(pool2_stage1, 256, 3, 1, activation_fn=None, scope='conv3_1')
conv3_1 = tf.nn.relu(conv3_1)
conv3_2 = layers.conv2d(conv3_1, 256, 3, 1, activation_fn=None, scope='conv3_2')
conv3_2 = tf.nn.relu(conv3_2)
conv3_3 = layers.conv2d(conv3_2, 256, 3, 1, activation_fn=None, scope='conv3_3')
conv3_3 = tf.nn.relu(conv3_3)
conv3_4 = layers.conv2d(conv3_3, 256, 3, 1, activation_fn=None, scope='conv3_4')
conv3_4 = tf.nn.relu(conv3_4)
pool3_stage1 = layers.max_pool2d(conv3_4, 2, 2)
conv4_1 = layers.conv2d(pool3_stage1, 512, 3, 1, activation_fn=None, scope='conv4_1')
conv4_1 = tf.nn.relu(conv4_1)
conv4_2 = layers.conv2d(conv4_1, 512, 3, 1, activation_fn=None, scope='conv4_2')
conv4_2 = tf.nn.relu(conv4_2)
conv4_3 = layers.conv2d(conv4_2, 512, 3, 1, activation_fn=None, scope='conv4_3')
conv4_3 = tf.nn.relu(conv4_3)
conv4_4 = layers.conv2d(conv4_3, 512, 3, 1, activation_fn=None, scope='conv4_4')
conv4_4 = tf.nn.relu(conv4_4)
conv5_1 = layers.conv2d(conv4_4, 512, 3, 1, activation_fn=None, scope='conv5_1')
conv5_1 = tf.nn.relu(conv5_1)
conv5_2_CPM = layers.conv2d(conv5_1, 128, 3, 1, activation_fn=None, scope='conv5_2_CPM')
conv5_2_CPM = tf.nn.relu(conv5_2_CPM)
conv6_1_CPM = layers.conv2d(conv5_2_CPM, 512, 1, 1, activation_fn=None, scope='conv6_1_CPM')
conv6_1_CPM = tf.nn.relu(conv6_1_CPM)
conv6_2_CPM = layers.conv2d(conv6_1_CPM, 1, 1, 1, activation_fn=None, scope='conv6_2_CPM')
concat_stage2 = tf.concat(axis=3, values=[conv6_2_CPM, conv5_2_CPM])
Mconv1_stage2 = layers.conv2d(concat_stage2, 128, 7, 1, activation_fn=None, scope='Mconv1_stage2')
Mconv1_stage2 = tf.nn.relu(Mconv1_stage2)
Mconv2_stage2 = layers.conv2d(Mconv1_stage2, 128, 7, 1, activation_fn=None, scope='Mconv2_stage2')
Mconv2_stage2 = tf.nn.relu(Mconv2_stage2)
Mconv3_stage2 = layers.conv2d(Mconv2_stage2, 128, 7, 1, activation_fn=None, scope='Mconv3_stage2')
Mconv3_stage2 = tf.nn.relu(Mconv3_stage2)
Mconv4_stage2 = layers.conv2d(Mconv3_stage2, 128, 7, 1, activation_fn=None, scope='Mconv4_stage2')
Mconv4_stage2 = tf.nn.relu(Mconv4_stage2)
Mconv5_stage2 = layers.conv2d(Mconv4_stage2, 128, 7, 1, activation_fn=None, scope='Mconv5_stage2')
Mconv5_stage2 = tf.nn.relu(Mconv5_stage2)
Mconv6_stage2 = layers.conv2d(Mconv5_stage2, 128, 1, 1, activation_fn=None, scope='Mconv6_stage2')
Mconv6_stage2 = tf.nn.relu(Mconv6_stage2)
Mconv7_stage2 = layers.conv2d(Mconv6_stage2, 1, 1, 1, activation_fn=None, scope='Mconv7_stage2')
concat_stage3 = tf.concat(axis=3, values=[Mconv7_stage2, conv5_2_CPM])
Mconv1_stage3 = layers.conv2d(concat_stage3, 128, 7, 1, activation_fn=None, scope='Mconv1_stage3')
Mconv1_stage3 = tf.nn.relu(Mconv1_stage3)
Mconv2_stage3 = layers.conv2d(Mconv1_stage3, 128, 7, 1, activation_fn=None, scope='Mconv2_stage3')
Mconv2_stage3 = tf.nn.relu(Mconv2_stage3)
Mconv3_stage3 = layers.conv2d(Mconv2_stage3, 128, 7, 1, activation_fn=None, scope='Mconv3_stage3')
Mconv3_stage3 = tf.nn.relu(Mconv3_stage3)
Mconv4_stage3 = layers.conv2d(Mconv3_stage3, 128, 7, 1, activation_fn=None, scope='Mconv4_stage3')
Mconv4_stage3 = tf.nn.relu(Mconv4_stage3)
Mconv5_stage3 = layers.conv2d(Mconv4_stage3, 128, 7, 1, activation_fn=None, scope='Mconv5_stage3')
Mconv5_stage3 = tf.nn.relu(Mconv5_stage3)
Mconv6_stage3 = layers.conv2d(Mconv5_stage3, 128, 1, 1, activation_fn=None, scope='Mconv6_stage3')
Mconv6_stage3 = tf.nn.relu(Mconv6_stage3)
Mconv7_stage3 = layers.conv2d(Mconv6_stage3, 1, 1, 1, activation_fn=None, scope='Mconv7_stage3')
concat_stage4 = tf.concat(axis=3, values=[Mconv7_stage3, conv5_2_CPM])
Mconv1_stage4 = layers.conv2d(concat_stage4, 128, 7, 1, activation_fn=None, scope='Mconv1_stage4')
Mconv1_stage4 = tf.nn.relu(Mconv1_stage4)
Mconv2_stage4 = layers.conv2d(Mconv1_stage4, 128, 7, 1, activation_fn=None, scope='Mconv2_stage4')
Mconv2_stage4 = tf.nn.relu(Mconv2_stage4)
Mconv3_stage4 = layers.conv2d(Mconv2_stage4, 128, 7, 1, activation_fn=None, scope='Mconv3_stage4')
Mconv3_stage4 = tf.nn.relu(Mconv3_stage4)
Mconv4_stage4 = layers.conv2d(Mconv3_stage4, 128, 7, 1, activation_fn=None, scope='Mconv4_stage4')
Mconv4_stage4 = tf.nn.relu(Mconv4_stage4)
Mconv5_stage4 = layers.conv2d(Mconv4_stage4, 128, 7, 1, activation_fn=None, scope='Mconv5_stage4')
Mconv5_stage4 = tf.nn.relu(Mconv5_stage4)
Mconv6_stage4 = layers.conv2d(Mconv5_stage4, 128, 1, 1, activation_fn=None, scope='Mconv6_stage4')
Mconv6_stage4 = tf.nn.relu(Mconv6_stage4)
Mconv7_stage4 = layers.conv2d(Mconv6_stage4, 1, 1, 1, activation_fn=None, scope='Mconv7_stage4')
return Mconv7_stage4
def inference_pose(image, center_map):
# corresponds to pose_deploy_centerMap.prototxt
with tf.variable_scope('PoseNet'):
pool_center_lower = layers.avg_pool2d(center_map, 9, 8, padding='VALID')
conv1_stage1 = layers.conv2d(image, 128, 9, 1, activation_fn=None, scope='conv1_stage1')
conv1_stage1 = tf.nn.relu(conv1_stage1)
pool1_stage1 = layers.max_pool2d(conv1_stage1, 3, 2)
conv2_stage1 = layers.conv2d(pool1_stage1, 128, 9, 1, activation_fn=None, scope='conv2_stage1')
conv2_stage1 = tf.nn.relu(conv2_stage1)
pool2_stage1 = layers.max_pool2d(conv2_stage1, 3, 2)
conv3_stage1 = layers.conv2d(pool2_stage1, 128, 9, 1, activation_fn=None, scope='conv3_stage1')
conv3_stage1 = tf.nn.relu(conv3_stage1)
pool3_stage1 = layers.max_pool2d(conv3_stage1, 3, 2)
conv4_stage1 = layers.conv2d(pool3_stage1, 32, 5, 1, activation_fn=None, scope='conv4_stage1')
conv4_stage1 = tf.nn.relu(conv4_stage1)
conv5_stage1 = layers.conv2d(conv4_stage1, 512, 9, 1, activation_fn=None, scope='conv5_stage1')
conv5_stage1 = tf.nn.relu(conv5_stage1)
conv6_stage1 = layers.conv2d(conv5_stage1, 512, 1, 1, activation_fn=None, scope='conv6_stage1')
conv6_stage1 = tf.nn.relu(conv6_stage1)
conv7_stage1 = layers.conv2d(conv6_stage1, 15, 1, 1, activation_fn=None, scope='conv7_stage1')
conv1_stage2 = layers.conv2d(image, 128, 9, 1, activation_fn=None, scope='conv1_stage2')
conv1_stage2 = tf.nn.relu(conv1_stage2)
pool1_stage2 = layers.max_pool2d(conv1_stage2, 3, 2)
conv2_stage2 = layers.conv2d(pool1_stage2, 128, 9, 1, activation_fn=None, scope='conv2_stage2')
conv2_stage2 = tf.nn.relu(conv2_stage2)
pool2_stage2 = layers.max_pool2d(conv2_stage2, 3, 2)
conv3_stage2 = layers.conv2d(pool2_stage2, 128, 9, 1, activation_fn=None, scope='conv3_stage2')
conv3_stage2 = tf.nn.relu(conv3_stage2)
pool3_stage2 = layers.max_pool2d(conv3_stage2, 3, 2)
conv4_stage2 = layers.conv2d(pool3_stage2, 32, 5, 1, activation_fn=None, scope='conv4_stage2')
conv4_stage2 = tf.nn.relu(conv4_stage2)
concat_stage2 = tf.concat(axis=3, values=[conv4_stage2, conv7_stage1, pool_center_lower])
Mconv1_stage2 = layers.conv2d(concat_stage2, 128, 11, 1, activation_fn=None, scope='Mconv1_stage2')
Mconv1_stage2 = tf.nn.relu(Mconv1_stage2)
Mconv2_stage2 = layers.conv2d(Mconv1_stage2, 128, 11, 1, activation_fn=None, scope='Mconv2_stage2')
Mconv2_stage2 = tf.nn.relu(Mconv2_stage2)
Mconv3_stage2 = layers.conv2d(Mconv2_stage2, 128, 11, 1, activation_fn=None, scope='Mconv3_stage2')
Mconv3_stage2 = tf.nn.relu(Mconv3_stage2)
Mconv4_stage2 = layers.conv2d(Mconv3_stage2, 128, 1, 1, activation_fn=None, scope='Mconv4_stage2')
Mconv4_stage2 = tf.nn.relu(Mconv4_stage2)
Mconv5_stage2 = layers.conv2d(Mconv4_stage2, 15, 1, 1, activation_fn=None, scope='Mconv5_stage2')
conv1_stage3 = layers.conv2d(pool3_stage2, 32, 5, 1, activation_fn=None, scope='conv1_stage3')
conv1_stage3 = tf.nn.relu(conv1_stage3)
concat_stage3 = tf.concat(axis=3, values=[conv1_stage3, Mconv5_stage2, pool_center_lower])
Mconv1_stage3 = layers.conv2d(concat_stage3, 128, 11, 1, activation_fn=None, scope='Mconv1_stage3')
Mconv1_stage3 = tf.nn.relu(Mconv1_stage3)
Mconv2_stage3 = layers.conv2d(Mconv1_stage3, 128, 11, 1, activation_fn=None, scope='Mconv2_stage3')
Mconv2_stage3 = tf.nn.relu(Mconv2_stage3)
Mconv3_stage3 = layers.conv2d(Mconv2_stage3, 128, 11, 1, activation_fn=None, scope='Mconv3_stage3')
Mconv3_stage3 = tf.nn.relu(Mconv3_stage3)
Mconv4_stage3 = layers.conv2d(Mconv3_stage3, 128, 1, 1, activation_fn=None, scope='Mconv4_stage3')
Mconv4_stage3 = tf.nn.relu(Mconv4_stage3)
Mconv5_stage3 = layers.conv2d(Mconv4_stage3, 15, 1, 1, activation_fn=None, scope='Mconv5_stage3')
conv1_stage4 = layers.conv2d(pool3_stage2, 32, 5, 1, activation_fn=None, scope='conv1_stage4')
conv1_stage4 = tf.nn.relu(conv1_stage4)
concat_stage4 = tf.concat(axis=3, values=[conv1_stage4, Mconv5_stage3, pool_center_lower])
Mconv1_stage4 = layers.conv2d(concat_stage4, 128, 11, 1, activation_fn=None, scope='Mconv1_stage4')
Mconv1_stage4 = tf.nn.relu(Mconv1_stage4)
Mconv2_stage4 = layers.conv2d(Mconv1_stage4, 128, 11, 1, activation_fn=None, scope='Mconv2_stage4')
Mconv2_stage4 = tf.nn.relu(Mconv2_stage4)
Mconv3_stage4 = layers.conv2d(Mconv2_stage4, 128, 11, 1, activation_fn=None, scope='Mconv3_stage4')
Mconv3_stage4 = tf.nn.relu(Mconv3_stage4)
Mconv4_stage4 = layers.conv2d(Mconv3_stage4, 128, 1, 1, activation_fn=None, scope='Mconv4_stage4')
Mconv4_stage4 = tf.nn.relu(Mconv4_stage4)
Mconv5_stage4 = layers.conv2d(Mconv4_stage4, 15, 1, 1, activation_fn=None, scope='Mconv5_stage4')
conv1_stage5 = layers.conv2d(pool3_stage2, 32, 5, 1, activation_fn=None, scope='conv1_stage5')
conv1_stage5 = tf.nn.relu(conv1_stage5)
concat_stage5 = tf.concat(axis=3, values=[conv1_stage5, Mconv5_stage4, pool_center_lower])
Mconv1_stage5 = layers.conv2d(concat_stage5, 128, 11, 1, activation_fn=None, scope='Mconv1_stage5')
Mconv1_stage5 = tf.nn.relu(Mconv1_stage5)
Mconv2_stage5 = layers.conv2d(Mconv1_stage5, 128, 11, 1, activation_fn=None, scope='Mconv2_stage5')
Mconv2_stage5 = tf.nn.relu(Mconv2_stage5)
Mconv3_stage5 = layers.conv2d(Mconv2_stage5, 128, 11, 1, activation_fn=None, scope='Mconv3_stage5')
Mconv3_stage5 = tf.nn.relu(Mconv3_stage5)
Mconv4_stage5 = layers.conv2d(Mconv3_stage5, 128, 1, 1, activation_fn=None, scope='Mconv4_stage5')
Mconv4_stage5 = tf.nn.relu(Mconv4_stage5)
Mconv5_stage5 = layers.conv2d(Mconv4_stage5, 15, 1, 1, activation_fn=None, scope='Mconv5_stage5')
conv1_stage6 = layers.conv2d(pool3_stage2, 32, 5, 1, activation_fn=None, scope='conv1_stage6')
conv1_stage6 = tf.nn.relu(conv1_stage6)
concat_stage6 = tf.concat(axis=3, values=[conv1_stage6, Mconv5_stage5, pool_center_lower])
Mconv1_stage6 = layers.conv2d(concat_stage6, 128, 11, 1, activation_fn=None, scope='Mconv1_stage6')
Mconv1_stage6 = tf.nn.relu(Mconv1_stage6)
Mconv2_stage6 = layers.conv2d(Mconv1_stage6, 128, 11, 1, activation_fn=None, scope='Mconv2_stage6')
Mconv2_stage6 = tf.nn.relu(Mconv2_stage6)
Mconv3_stage6 = layers.conv2d(Mconv2_stage6, 128, 11, 1, activation_fn=None, scope='Mconv3_stage6')
Mconv3_stage6 = tf.nn.relu(Mconv3_stage6)
Mconv4_stage6 = layers.conv2d(Mconv3_stage6, 128, 1, 1, activation_fn=None, scope='Mconv4_stage6')
Mconv4_stage6 = tf.nn.relu(Mconv4_stage6)
Mconv5_stage6 = layers.conv2d(Mconv4_stage6, 15, 1, 1, activation_fn=None, scope='Mconv5_stage6')
return Mconv5_stage6
def inference_pose_v2(image, center_map):
# corresponds to pose_deploy_resize.prototxt
with tf.variable_scope('PoseNet'):
pool_center_lower = layers.avg_pool2d(center_map, 9, 8, padding='SAME')
conv1_1 = layers.conv2d(image, 64, 3, 1, activation_fn=None, scope='conv1_1')
conv1_1 = tf.nn.relu(conv1_1)
conv1_2 = layers.conv2d(conv1_1, 64, 3, 1, activation_fn=None, scope='conv1_2')
conv1_2 = tf.nn.relu(conv1_2)
pool1_stage1 = layers.max_pool2d(conv1_2, 2, 2)
conv2_1 = layers.conv2d(pool1_stage1, 128, 3, 1, activation_fn=None, scope='conv2_1')
conv2_1 = tf.nn.relu(conv2_1)
conv2_2 = layers.conv2d(conv2_1, 128, 3, 1, activation_fn=None, scope='conv2_2')
conv2_2 = tf.nn.relu(conv2_2)
pool2_stage1 = layers.max_pool2d(conv2_2, 2, 2)
conv3_1 = layers.conv2d(pool2_stage1, 256, 3, 1, activation_fn=None, scope='conv3_1')
conv3_1 = tf.nn.relu(conv3_1)
conv3_2 = layers.conv2d(conv3_1, 256, 3, 1, activation_fn=None, scope='conv3_2')
conv3_2 = tf.nn.relu(conv3_2)
conv3_3 = layers.conv2d(conv3_2, 256, 3, 1, activation_fn=None, scope='conv3_3')
conv3_3 = tf.nn.relu(conv3_3)
conv3_4 = layers.conv2d(conv3_3, 256, 3, 1, activation_fn=None, scope='conv3_4')
conv3_4 = tf.nn.relu(conv3_4)
pool3_stage1 = layers.max_pool2d(conv3_4, 2, 2)
conv4_1 = layers.conv2d(pool3_stage1, 512, 3, 1, activation_fn=None, scope='conv4_1')
conv4_1 = tf.nn.relu(conv4_1)
conv4_2 = layers.conv2d(conv4_1, 512, 3, 1, activation_fn=None, scope='conv4_2')
conv4_2 = tf.nn.relu(conv4_2)
conv4_3_CPM = layers.conv2d(conv4_2, 256, 3, 1, activation_fn=None, scope='conv4_3_CPM')
conv4_3_CPM = tf.nn.relu(conv4_3_CPM)
conv4_4_CPM = layers.conv2d(conv4_3_CPM, 256, 3, 1, activation_fn=None, scope='conv4_4_CPM')
conv4_4_CPM = tf.nn.relu(conv4_4_CPM)
conv4_5_CPM = layers.conv2d(conv4_4_CPM, 256, 3, 1, activation_fn=None, scope='conv4_5_CPM')
conv4_5_CPM = tf.nn.relu(conv4_5_CPM)
conv4_6_CPM = layers.conv2d(conv4_5_CPM, 256, 3, 1, activation_fn=None, scope='conv4_6_CPM')
conv4_6_CPM = tf.nn.relu(conv4_6_CPM)
conv4_7_CPM = layers.conv2d(conv4_6_CPM, 128, 3, 1, activation_fn=None, scope='conv4_7_CPM')
conv4_7_CPM = tf.nn.relu(conv4_7_CPM)
conv5_1_CPM = layers.conv2d(conv4_7_CPM, 512, 1, 1, activation_fn=None, scope='conv5_1_CPM')
conv5_1_CPM = tf.nn.relu(conv5_1_CPM)
conv5_2_CPM = layers.conv2d(conv5_1_CPM, 15, 1, 1, activation_fn=None, scope='conv5_2_CPM')
concat_stage2 = tf.concat(axis=3, values=[conv5_2_CPM, conv4_7_CPM, pool_center_lower])
Mconv1_stage2 = layers.conv2d(concat_stage2, 128, 7, 1, activation_fn=None, scope='Mconv1_stage2')
Mconv1_stage2 = tf.nn.relu(Mconv1_stage2)
Mconv2_stage2 = layers.conv2d(Mconv1_stage2, 128, 7, 1, activation_fn=None, scope='Mconv2_stage2')
Mconv2_stage2 = tf.nn.relu(Mconv2_stage2)
Mconv3_stage2 = layers.conv2d(Mconv2_stage2, 128, 7, 1, activation_fn=None, scope='Mconv3_stage2')
Mconv3_stage2 = tf.nn.relu(Mconv3_stage2)
Mconv4_stage2 = layers.conv2d(Mconv3_stage2, 128, 7, 1, activation_fn=None, scope='Mconv4_stage2')
Mconv4_stage2 = tf.nn.relu(Mconv4_stage2)
Mconv5_stage2 = layers.conv2d(Mconv4_stage2, 128, 7, 1, activation_fn=None, scope='Mconv5_stage2')
Mconv5_stage2 = tf.nn.relu(Mconv5_stage2)
Mconv6_stage2 = layers.conv2d(Mconv5_stage2, 128, 1, 1, activation_fn=None, scope='Mconv6_stage2')
Mconv6_stage2 = tf.nn.relu(Mconv6_stage2)
Mconv7_stage2 = layers.conv2d(Mconv6_stage2, 15, 1, 1, activation_fn=None, scope='Mconv7_stage2')
concat_stage3 = tf.concat(axis=3, values=[Mconv7_stage2, conv4_7_CPM, pool_center_lower])
Mconv1_stage3 = layers.conv2d(concat_stage3, 128, 7, 1, activation_fn=None, scope='Mconv1_stage3')
Mconv1_stage3 = tf.nn.relu(Mconv1_stage3)
Mconv2_stage3 = layers.conv2d(Mconv1_stage3, 128, 7, 1, activation_fn=None, scope='Mconv2_stage3')
Mconv2_stage3 = tf.nn.relu(Mconv2_stage3)
Mconv3_stage3 = layers.conv2d(Mconv2_stage3, 128, 7, 1, activation_fn=None, scope='Mconv3_stage3')
Mconv3_stage3 = tf.nn.relu(Mconv3_stage3)
Mconv4_stage3 = layers.conv2d(Mconv3_stage3, 128, 7, 1, activation_fn=None, scope='Mconv4_stage3')
Mconv4_stage3 = tf.nn.relu(Mconv4_stage3)
Mconv5_stage3 = layers.conv2d(Mconv4_stage3, 128, 7, 1, activation_fn=None, scope='Mconv5_stage3')
Mconv5_stage3 = tf.nn.relu(Mconv5_stage3)
Mconv6_stage3 = layers.conv2d(Mconv5_stage3, 128, 1, 1, activation_fn=None, scope='Mconv6_stage3')
Mconv6_stage3 = tf.nn.relu(Mconv6_stage3)
Mconv7_stage3 = layers.conv2d(Mconv6_stage3, 15, 1, 1, activation_fn=None, scope='Mconv7_stage3')
concat_stage4 = tf.concat(axis=3, values=[Mconv7_stage3, conv4_7_CPM, pool_center_lower])
Mconv1_stage4 = layers.conv2d(concat_stage4, 128, 7, 1, activation_fn=None, scope='Mconv1_stage4')
Mconv1_stage4 = tf.nn.relu(Mconv1_stage4)
Mconv2_stage4 = layers.conv2d(Mconv1_stage4, 128, 7, 1, activation_fn=None, scope='Mconv2_stage4')
Mconv2_stage4 = tf.nn.relu(Mconv2_stage4)
Mconv3_stage4 = layers.conv2d(Mconv2_stage4, 128, 7, 1, activation_fn=None, scope='Mconv3_stage4')
Mconv3_stage4 = tf.nn.relu(Mconv3_stage4)
Mconv4_stage4 = layers.conv2d(Mconv3_stage4, 128, 7, 1, activation_fn=None, scope='Mconv4_stage4')
Mconv4_stage4 = tf.nn.relu(Mconv4_stage4)
Mconv5_stage4 = layers.conv2d(Mconv4_stage4, 128, 7, 1, activation_fn=None, scope='Mconv5_stage4')
Mconv5_stage4 = tf.nn.relu(Mconv5_stage4)
Mconv6_stage4 = layers.conv2d(Mconv5_stage4, 128, 1, 1, activation_fn=None, scope='Mconv6_stage4')
Mconv6_stage4 = tf.nn.relu(Mconv6_stage4)
Mconv7_stage4 = layers.conv2d(Mconv6_stage4, 15, 1, 1, activation_fn=None, scope='Mconv7_stage4')
concat_stage5 = tf.concat(axis=3, values=[Mconv7_stage4, conv4_7_CPM, pool_center_lower])
Mconv1_stage5 = layers.conv2d(concat_stage5, 128, 7, 1, activation_fn=None, scope='Mconv1_stage5')
Mconv1_stage5 = tf.nn.relu(Mconv1_stage5)
Mconv2_stage5 = layers.conv2d(Mconv1_stage5, 128, 7, 1, activation_fn=None, scope='Mconv2_stage5')
Mconv2_stage5 = tf.nn.relu(Mconv2_stage5)
Mconv3_stage5 = layers.conv2d(Mconv2_stage5, 128, 7, 1, activation_fn=None, scope='Mconv3_stage5')
Mconv3_stage5 = tf.nn.relu(Mconv3_stage5)
Mconv4_stage5 = layers.conv2d(Mconv3_stage5, 128, 7, 1, activation_fn=None, scope='Mconv4_stage5')
Mconv4_stage5 = tf.nn.relu(Mconv4_stage5)
Mconv5_stage5 = layers.conv2d(Mconv4_stage5, 128, 7, 1, activation_fn=None, scope='Mconv5_stage5')
Mconv5_stage5 = tf.nn.relu(Mconv5_stage5)
Mconv6_stage5 = layers.conv2d(Mconv5_stage5, 128, 1, 1, activation_fn=None, scope='Mconv6_stage5')
Mconv6_stage5 = tf.nn.relu(Mconv6_stage5)
Mconv7_stage5 = layers.conv2d(Mconv6_stage5, 15, 1, 1, activation_fn=None, scope='Mconv7_stage5')
concat_stage6 = tf.concat(axis=3, values=[Mconv7_stage5, conv4_7_CPM, pool_center_lower])
Mconv1_stage6 = layers.conv2d(concat_stage6, 128, 7, 1, activation_fn=None, scope='Mconv1_stage6')
Mconv1_stage6 = tf.nn.relu(Mconv1_stage6)
Mconv2_stage6 = layers.conv2d(Mconv1_stage6, 128, 7, 1, activation_fn=None, scope='Mconv2_stage6')
Mconv2_stage6 = tf.nn.relu(Mconv2_stage6)
Mconv3_stage6 = layers.conv2d(Mconv2_stage6, 128, 7, 1, activation_fn=None, scope='Mconv3_stage6')
Mconv3_stage6 = tf.nn.relu(Mconv3_stage6)
Mconv4_stage6 = layers.conv2d(Mconv3_stage6, 128, 7, 1, activation_fn=None, scope='Mconv4_stage6')
Mconv4_stage6 = tf.nn.relu(Mconv4_stage6)
Mconv5_stage6 = layers.conv2d(Mconv4_stage6, 128, 7, 1, activation_fn=None, scope='Mconv5_stage6')
Mconv5_stage6 = tf.nn.relu(Mconv5_stage6)
Mconv6_stage6 = layers.conv2d(Mconv5_stage6, 128, 1, 1, activation_fn=None, scope='Mconv6_stage6')
Mconv6_stage6 = tf.nn.relu(Mconv6_stage6)
Mconv7_stage6 = layers.conv2d(Mconv6_stage6, 15, 1, 1, activation_fn=None, scope='Mconv7_stage6')
return Mconv7_stage6