Lingchen Sun1,2 | Jie Liang2 | Shuaizheng Liu1,2 | Hongwei Yong1 | Lei Zhang1,2
1The Hong Kong Polytechnic University, 2OPPO Research Institute
⭐ If EA-Adam is helpful to your images or projects, please help star this repo. Thanks! 🤗
For more comparisons, please refer to our paper for details.## git clone this repository
git clone https://github.com/csslc/EA-Adam.git
cd EA-Adam
# create an environment
conda create -n EA-Adam python=3.10 -y
conda activate EA-Adam
pip install -r requirements.txt
Download from GoogleDrive.
Download from BaiduNetdisk (pwd: 0930).
You can put the testing images in the test_input
.
python test.py \
--input_image test_input \
--config configs/mulsrresnet_gan.yml \
--test_model_path pretrained_models/EA-Adam-srresnet.pt \
--root_img output
If you want to test RRDB-based and SwinIR-based models, please modify the test_model_path
and config
accordingly.
We take the SRResNet backbone as example. Please check and adapt the config files firstly.
- EA-Adam stage.
A model pretrained with L1 loss needs to be used for stable training, similar to SRGAN, ESRGAN, and other GAN-based SR models.
python train_EA-Adam_srresnet.py \
--config configs/mulsrresnet_gan.yml \
--resume l1-pretrained/ \
- Weight regression network training.
N
expert models can be obtained during the EA-Adam stage and should be placed in fusion_experts
for training weight regression network.
The final discriminator from the EA-Adam stage can serve as a pretrained model to facilitate faster convergence.
python train_fusion_srresnet.py \
--config configs/fusion_srresnet.yml \
--expert_path fusion_experts/ \
--resume_d disc.pt
- Model fusion.
The fusion models from weight regression network training stage is placed in fusion_model
.
The final model is saved in final_model_path
.
python train_cal_weight.py \
--config configs/fusion_srresnet.yml \
--test_model_path fusion_model/ \
--expert_path fusion_experts/ \
--final_model_path experiments/EA-Adam-srresnet/
This project is released under the Apache 2.0 license.
This project is built based on the SimpleIR and E-GAN projects. Thanks for their awesome works.
If our code helps your research or work, please consider citing our paper. The following are BibTeX references:
@article{sun2024eaadam,
title={Perception-Distortion Balanced Super-Resolution: A Multi-Objective Optimization Perspective},
author={Sun, Lingchen and Liang, Jie and Liu, Shuaizheng and Yong, Hongwei and Zhang, Lei},
journal={IEEE Transactions on Image Processing},
year={2024}
}
If you have any questions, please feel free to contact: [email protected]