Yuehan Zhang1, Seungjun Lee2, Angela Yao1
National University of Singapore1, Korea University2
We address the unsupervised RWSR for a targeted real-world degradation. We study from a distillation perspective and introduce a novel Pairwise Distance Distillation framework. Through our framework, a model specialized in synthetic degradation adapts to target real-world degradations by distilling intra- and inter-model distances across the specialized model and an auxiliary generalized model.
Our method, as a learning framework, can be applied to off-the-shelf generalist models, e.g., RealESRGAN, and improve their performance in a real-world domain!
RealESRGAN + PDD | RealESRAGN
We tackle the unsupervised SR for a given real-world dataset through a distillation perspective:
The distillation is based on the consistency of intra- and inter-model distances. We refer to the paper for explorations that establish these consistencies π.
We provide Static and EMA configurations for our method. The latter requires a single pretrained model and exhibits better performance.
Python >= 3.9
PyTorch > 2.0
mmcv (recommend mmcv==2.1.0)
MMEngine
mmagic
# Clone the repository
git clone https://github.com/Yuehan717/PDD.git
# Navigate into the repository
cd PDD
# Install dependencies
pip install -r requirements.txt
Our method requires two sets of data for training:
# training instructions
### Please replace the path in .yml files with our own path.
## Distributed Training (recommend 2 gpus)
PYTHONPATH="./:${PYTHONPATH}" \
torchrun --nproc_per_node=[number_of_gpus] --master_port=[port] basicsr/train_mix.py \
-opt options/train/ESRGAN/[name_of_script].yml --launcher pytorch
## One-GPU Training
PYTHONPATH="./:${PYTHONPATH}" \
python basicsr/train_mix.py -opt options/train/ESRGAN/[name_of_script].yml
# Inference
python inference_SISR.py --input_path [path_to_input_folder] \
--save_path [path_to_result_folder] --model [esrgan/bsrgan] \
--model_path [path_to_model_weights] --color_corr
The code is based on BasicSR. Thanks to their great contribution to the area!