TensorFlow implementation of FSRCNN with quantized version. This implements illustrates that FSRCNN adopted with 16-bit fixed-point representation delivers performance nearly identical as a full precision one.
- Python 2.7
- TensorFlow version> 1.2
- numpy
- Scipy version > 0.18
- h5py
- PIL
-
Download the caffe training code from here, place folder
TrainandTestinto($root). -
Open MATLAB and run
generate_train.mandgenerate_test.mto generate training and test data. You can also rundata_aug.mto do data augmentation first. -
Modify the flags
data_dirandtest_dirinmodel.pyas paths to the directory. -
Set
NUM_EXAMPLES_PER_EPOCH_FOR_TRAINinutils.pyas the number of samples for training. -
To train a new model, run
FSRCNN.py --train True --gpu 0,1 --quantize Truefor training. And simultaneously runFSRCNN.py --train False --gpu 0 --quantize Truefor testing. Note thatreloadflag can be set toTruefor reloading a pre-train model. More flags are available for different usages. CheckFSRCNN.pyfor all the possible flags. -
After training, you can evaluate performance of the model with
TensorBoard. Runtensorboard --logdir=/tmp/FSRCNN_eval. Also, you can extract parameters and save them in the format.matby set the flagsavetoTrue.