diff --git a/modules/deeplearning/espcn.py b/modules/deeplearning/espcn.py index e049d9c8135f7803f0f117c177d6c87d40e45212..b7ee4385a1fabf3c0a457cc77b5c770cc4bdd59b 100644 --- a/modules/deeplearning/espcn.py +++ b/modules/deeplearning/espcn.py @@ -370,7 +370,7 @@ class ESPCN: activation = tf.nn.leaky_relu momentum = 0.99 - num_filters = 64 + num_filters = 32 input_2d = self.inputs[0] print('input: ', input_2d.shape) @@ -383,7 +383,7 @@ class ESPCN: conv = conv_b = tf.keras.layers.Conv2D(num_filters, kernel_size=3, padding=padding)(input_2d) if NOISE_TRAINING: - conv = tf.keras.layers.GaussianNoise(stddev=NOISE_STDDEV)(conv) + conv = conv_b = tf.keras.layers.GaussianNoise(stddev=NOISE_STDDEV)(conv) conv_b = build_conv2d_block(conv_b, num_filters, 'Residual_Block_1') @@ -391,13 +391,15 @@ class ESPCN: conv_b = build_conv2d_block(conv_b, num_filters, 'Residual_Block_3') - conv_b = tf.keras.layers.Conv2D(num_filters // 2, kernel_size=3, strides=1, padding=padding)(conv_b) + conv_b = build_conv2d_block(conv_b, num_filters, 'Residual_Block_4') + + conv_b = tf.keras.layers.Conv2D(num_filters, kernel_size=3, strides=1, padding=padding)(conv_b) conv = conv + conv_b print(conv.shape) - # conv = tf.keras.layers.Conv2D(num_filters * (factor ** 2), 3, padding='same')(conv) - conv = tf.keras.layers.Conv2D((factor ** 2), 3, padding='same')(conv) + conv = tf.keras.layers.Conv2D(num_filters * (factor ** 2), 3, padding='same')(conv) + # conv = tf.keras.layers.Conv2D((factor ** 2), 3, padding='same')(conv) print(conv.shape) conv = tf.nn.depth_to_space(conv, factor)