def _add_seglink_layers(self):
all_seg_scores = []
all_seg_offsets = []
all_within_layer_link_scores = []
all_cross_layer_link_scores = []
for layer_name in self.feat_layers:
with tf.variable_scope(layer_name):
seg_scores, seg_offsets, within_layer_link_scores, cross_layer_link_scores = self._build_seg_link_layer(layer_name)
all_seg_scores.append(seg_scores)
all_seg_offsets.append(seg_offsets)
all_within_layer_link_scores.append(within_layer_link_scores)
all_cross_layer_link_scores.append(cross_layer_link_scores)
self.seg_score_logits = reshape_and_concat(all_seg_scores) # (batch_size, N, 2)
self.seg_scores = slim.softmax(self.seg_score_logits) # (batch_size, N, 2)
self.seg_offsets = reshape_and_concat(all_seg_offsets) # (batch_size, N, 5)
self.cross_layer_link_scores = reshape_and_concat(all_cross_layer_link_scores) # (batch_size, 8N, 2)
self.within_layer_link_scores = reshape_and_concat(all_within_layer_link_scores) # (batch_size, 4(N - N_conv4_3), 2)
self.link_score_logits = tf.concat([self.within_layer_link_scores, self.cross_layer_link_scores], axis = 1)
self.link_scores = slim.softmax(self.link_score_logits)
tf.summary.histogram('link_scores', self.link_scores)
tf.summary.histogram('seg_scores', self.seg_scores)
评论列表
文章目录