- PyTorch >= 1.7 (Recommend NOT using torch 1.8!!! It would cause abnormal performance. we used PyTorch version 1.12.)
- BasicSR == 1.3.4.9
git clone https://github.com/kimtaehyeong/NTIRE2023_ImageSR_x4_LDCC.git
- The models weights should download to
model_zoo
directory at Google Drive - Select the model you would like to test from
run.sh
for example :CUDA_VISIBLE_DEVICES=0 python test_demo.py --data_dir [path to your data dir] --save_dir [path to your save dir] --model_id [number]
CUDA_VISIBLE_DEVICES=0 python test_demo.py --data_dir /home/work/NTIRE/dataset/SUB --save_dir ./results --model_id 2
from utils.model_summary import get_model_flops, get_model_activation
from models.team00_RFDN import RFDN
model = RFDN()
input_dim = (3, 256, 256) # set the input dimension
activations, num_conv = get_model_activation(model, input_dim)
activations = activations / 10 ** 6
print("{:>16s} : {:<.4f} [M]".format("#Activations", activations))
print("{:>16s} : {:<d}".format("#Conv2d", num_conv))
flops = get_model_flops(model, input_dim, False)
flops = flops / 10 ** 9
print("{:>16s} : {:<.4f} [G]".format("FLOPs", flops))
num_parameters = sum(map(lambda x: x.numel(), model.parameters()))
num_parameters = num_parameters / 10 ** 6
print("{:>16s} : {:<.4f} [M]".format("#Params", num_parameters))
This code is built on HAT codebase. We thank the authors for sharing the codes.
Jungkeong Kil, Eon Kim, Taehyung Kim, Yeonseung Yu, Beomyeol Lee, Subin Lee, Seokjae Lim, Somi Chae, Heungjun Choi
This code repository is release under MIT License.