Skip to content
Tensorflow with Image Super-Resolution Using Dense Skip Connections , color
Branch: master
Clone or download
Latest commit f1cf877 Jan 10, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
Test/Set5 fix the batch size and weight init Jan 9, 2018
Train Delete butterfly_GT.bmp Jan 10, 2018
.gitignore add gitignore Dec 28, 2017
LICENSE Create LICENSE Jan 10, 2018 Update Jan 10, 2018 fix the batch size and weight init Jan 9, 2018 finish Jan 10, 2018


GitHub license


We present a highly accurate single-image super-resolution (SR) method, Use the DenseNet, and use deconvulotion to scaling, the network model of densenet is:

def desBlock(self, desBlock_layer, outlayer, filter_size=3 ):
        nextlayer = self.low_conv
        conv = list()
        for i in range(1, outlayer+1):
            conv_in = list()
            for j in range(1, desBlock_layer+1):
                # The first conv need connect with low level layer
                if j is 1:
                    x = tf.nn.conv2d(nextlayer, self.weight_block['w_H_%d_%d' %(i, j)], strides=[1,1,1,1], padding='SAME') + self.biases_block['b_H_%d_%d' % (i, j)]
                    x = tf.nn.relu(x)
                    x = Concatenation(conv_in)
                    x = tf.nn.conv2d(x, self.weight_block['w_H_%d_%d' % (i, j)], strides=[1,1,1,1], padding='SAME')+ self.biases_block['b_H_%d_%d' % (i, j)]
                    x = tf.nn.relu(x)

            nextlayer = conv_in[-1]
        return conv



  • TensorFlow
  • OpenCV
  • h5py


  • Ubuntu 16.04
  • Python 2.7

If you meet the problem with opencv when run the program cannot open shared object file: No such file or directory

please install dependency package

sudo apt-get install libsm6
sudo apt-get install libxrender1

All Parameter

usage: [-h] [--epoch EPOCH] [--image_size IMAGE_SIZE]
               [--label_size LABEL_SIZE] [--c_dim C_DIM]
               [--is_train [IS_TRAIN]] [--nois_train] [--scale SCALE]
               [--stride STRIDE] [--checkpoint_dir CHECKPOINT_DIR]
               [--learning_rate LEARNING_RATE] [--batch_size BATCH_SIZE]
               [--des_block_H DES_BLOCK_H] [--des_block_ALL DES_BLOCK_ALL]
               [--result_dir RESULT_DIR] [--growth_rate GROWTH_RATE]
               [--test_img TEST_IMG]

optional arguments:
  -h, --help            show this help message and exit
  --epoch EPOCH         Number of epoch
  --image_size IMAGE_SIZE
                        The size of image input
  --label_size LABEL_SIZE
                        The size of label
  --c_dim C_DIM         The size of channel
  --is_train [IS_TRAIN]
                        if the train
  --scale SCALE         the size of scale factor for preprocessing input image
  --stride STRIDE       the size of stride
  --checkpoint_dir CHECKPOINT_DIR
                        Name of checkpoint directory
  --learning_rate LEARNING_RATE
                        The learning rate
  --batch_size BATCH_SIZE
                        the size of batch
  --des_block_H DES_BLOCK_H
                        the size dense_block layer number
  --des_block_ALL DES_BLOCK_ALL
                        the size dense_block
  --result_dir RESULT_DIR
                        Name of result directory
  --growth_rate GROWTH_RATE
                        the size of growrate
  --test_img TEST_IMG   test_img

if you want to see the flag

python -h

How to train


How to test

python --is_train False --stride 50

If you want to Test your own iamge

use test_img flag

python --is_train False --stride 50 --test_img Train/t20.bmp

then result image also put in the result directory


  • Origin


  • Bicbuic


  • Result

Because the stride is 50, some part are cut.

You can’t perform that action at this time.