An unofficial PyTorch port (and subsequent modification) of NJU-Jet/SR_Mobile_Quantization.
git clone https://github.com/w11wo/sr_mobile_pytorch.git
cd sr_mobile_pytorch
pip install .To begin with, modify file paths, config, and training arguments in sr_mobile_pytorch/config. Then, launch the preprocessing script to group images into train and validation sets.
sh scripts/preprocess.shThe process involves finding suitable images for validation, that is, images whose dimensions are exact multiples of 4; i.e. and
. This is to facilitate the PSNR metric calculation.
We follow a slightly different pre-training regime: incorporating content loss together with pixel-wise L1 loss. This is heavily inspired by fast.ai's super resolution training.
sh scripts/pretrain.shYou can optionally fine-tune the model in a SRGAN-like setting, incorporating additional generator-discriminator loss terms.
sh scripts/finetune.sh