def pan_feature_extraction(self, name, pan): with tf.variable_scope(name, reuse=tf.AUTO_REUSE): with tf.variable_scope('low_level_extraction'): feature = pan feature = conv('conv1', feature, 32) feature = conv('conv2', feature, 32) with tf.variable_scope('down_sample1'): feature = self.downsample(feature, 32) feature = dense_block('dense_block1', feature, 12, conv_num=6, input_include=True) feature = bottle_neck('bottle_neck1', feature, 64) with tf.variable_scope('down_sample2'): feature = self.downsample(feature, 64) feature = dense_block('dense_block2', feature, 12, conv_num=6, input_include=True) feature = bottle_neck('bottle_neck2', feature, 64) feature = dense_block('dense_block3', feature, 12, conv_num=8, input_include=True) feature = bottle_neck('bottle_neck3', feature, 96) with tf.variable_scope('upsample1', reuse=tf.AUTO_REUSE): pan_feature_1 = self.upsample(feature, out_channel=96) # pan_feature_1 = conv('conv', tf.concat([feature2, feature3], -1), filter_num=64) with tf.variable_scope('upsample2', reuse=tf.AUTO_REUSE): pan_feature_2 = self.upsample(pan_feature_1, out_channel=96) # pan_feature_2 = conv('conv', tf.concat([up_pan_feature_1, feature1], -1), filter_num=64) return pan_feature_1, pan_feature_2
def ms_feature_extraction(self, name, ms): with tf.variable_scope(name, reuse=tf.AUTO_REUSE): with tf.variable_scope('low_level_extraction', reuse=tf.AUTO_REUSE): feature1 = ms feature1 = conv('conv1', feature1, 64) feature1 = conv('conv2', feature1, 64) feature2 = dense_block('dense_block1', feature1, 12, conv_num=6, input_include=True) feature2 = bottle_neck('bottle_neck1', feature2, 64) feature3 = dense_block('dense_block2', feature2, 12, conv_num=6, input_include=True) feature3 = bottle_neck('bottle_neck2', feature3, 64) with tf.variable_scope('combanation'): feature = tf.concat([feature1, feature2, feature3], -1) feature = bottle_neck('bottle_neck', feature, 64) with tf.variable_scope('upsample1', reuse=tf.AUTO_REUSE): ms_feature_1 = self.upsample(feature, out_channel=64) with tf.variable_scope('upsample2', reuse=tf.AUTO_REUSE): ms_feature_2 = self.upsample(ms_feature_1, out_channel=64) return ms_feature_1, ms_feature_2
def ms_feature_extraction(self, name, ms): with tf.variable_scope(name, reuse=tf.AUTO_REUSE): with tf.variable_scope('low_level_extraction', reuse=tf.AUTO_REUSE): feature = ms feature = conv('conv1', feature, 32) feature = conv('conv2', feature, 32) feature = dense_block('dense_block1', feature, 12, conv_num=4, input_include=True) feature = bottle_neck('bottle_neck1', feature, 64) feature = dense_block('dense_block2', feature, 12, conv_num=6, input_include=True) feature = bottle_neck('bottle_neck2', feature, 96) with tf.variable_scope('upsample1', reuse=tf.AUTO_REUSE): ms_feature_1 = self.upsample(feature, out_channel=96) with tf.variable_scope('upsample2', reuse=tf.AUTO_REUSE): ms_feature_2 = self.upsample(ms_feature_1, out_channel=96) return ms_feature_1, ms_feature_2