Home

Awesome

ECCV2022 Paper - Dynamic Dual Trainable Bounds for Ultra-low Precision Super-Resolution Networks paper

Dependence

Datasets

Please download DIV2K datasets.

Then, create a directory 'datasets' and re-organise the downloaded dataset directory as follows:

...
option.py
main_limitrange_incremental.py
datasets
  benchmark
  DIV2K

Usage

1: train full-precision models:

An example:

python main_ori.py --model edsr --scale 4 \
--save edsr_baseline_x4 \
--patch_size 192 \
--epochs 300 \
--decay 200 \
--gclip 0 \
--dir_data ./datasets

Please refer to 'baseline.sh' for more commands.

2: train quantized models:

An example:

python main_limitrange_incremental.py --scale 4 \
--k_bits 4 --model EDSR \
--pre_train ./pretrained/edsr_baseline_x4.pt --patch_size 192 \
--data_test Set14 \
--dynamic_ratio 0.3 \
--save "output/edsrx4/4bit" --dir_data ./datasets --print_every 10

Please refer to 'run.sh' for more commands.

3: test quantized models

An example:

python3 main_limitrange_incremental.py --scale 4 --model EDSR \
--k_bits 4 --save_results --test_only \
--data_test Set5+Set14+B100+Urban100  \
--save "../experiment/output/edsrx4/4bit" --dir_data ./datasets

Please refer to 'test.sh' for more commands.

calculate PSNR/SSIM

After saving the images, modify path inmetrics/calculate_PSNR_SSIM.m to generate results.

matlab -nodesktop -nosplash -r "calculate_PSNR_SSIM('$dataset',$scale,$bit);quit"

refer to metrics/run.sh for more details.

Trained FP models and quantized models: here

Download these model. Then use the commands above to obtain the reported results of the paper.

ModelBit
EDSRx42
3
4
EDSRx22
3
4
RDNx42
3
4
RDNx22
3
4
SRResNetx42
3
4
SRResNetx22
3
4

Results of pre-trained models are shown below:

EDSR

ModelDatasetBitDDTB(Ours)
EDSRx4Set5230.97/0.876
331.52/0.883
431.85/0.889
Set14227.87/0.764
328.18/0.771
428.39/0.777
BSD100227.09/0.719
327.30/0.727
427.44/0.732
Urban100224.82/0.742
325.33/0.761
425.69/0.774
EDSRx2Set5237.25/0.958
337.51/0.958
437.72/0.959
Set14232.87/0.911
333.17/0.914
433.35/0.916
BSD100231.67/0.893
331.89/0.896
432.01/0.898
Urban100230.34/0.910
331.01/0.919
431.39/0.922

RDN

ModelDatasetBitDDTB(Ours)
RDNx4Set5230.57/0.867
331.49/0.883
431.97/0.891
Set14227.56/0.757
328.17/0.772
428.49/0.780
BDS100226.91/0.714
327.30/0.728
427.49/0.735
Urban100224.50/0.728
325.35/0.764
425.90/0.783
RDNx2Set5236.76/0.955
337.61/0.959
437.88/0.960
Set14232.54/0.908
333.26/0.915
433.51/0.917
BSD100231.44/0.890
331.91/0.897
432.12/0.899
Urban100229.77/0.903
331.10/0.920
431.76/0.926

SRResNet

ModelDatasetBitDDTB(Ours)
SRResNetx4Set5231.51/0.887
331.85/0.890
431.97/0.892
Set14228.23/0.773
328.39/0.776
428.46/0.778
BSD100227.33/0.728
327.44/0.731
427.48/0.733
Urban100225.37/0.762
325.64/0.770
425.77/0.776
SRResNetx2Set5237.46/0.958
337.67/0.959
437.78/0.960
Set14233.02/0.913
333.24/0.915
433.32/0.916
BSD100231.78/0.895
331.95/0.897
432.03/0.898
Urban100230.57/0.913
331.15/0.919
431.40/0.921

Contact

For any question, be free to contact: viper.zhong@gmail.com. The github issue is also welcome.