(CVPR 2025) Adversarial Diffusion Compression for Real-World Image Super-Resolution [PyTorch]
290
stars
74
commits
Python
primary language
Apr 5, 2025
updated
Bin Chen1,3,* | Gehui Li1,* | Rongyuan Wu2,3,* | Xindong Zhang3 | Jie Chen1,† | Jian Zhang1,† | Lei Zhang2,3
1 School of Electronic and Computer Engineering, Peking University
2 The Hong Kong Polytechnic University, 3 OPPO Research Institute
* Equal Contribution. † Corresponding Authors.
⭐ If AdcSR is helpful to you, please star this repo. Thanks! 🤗
https://github.com/user-attachments/assets/1211cefa-8704-47f5-82cd-ec4ef084b9ec
git clone https://github.com/Guaishou74851/AdcSR.git
cd AdcSR
conda create -n AdcSR python=3.10
conda activate AdcSR
pip install --upgrade pip
pip install -r requirements.txt
chmod +x train.sh train_debug.sh test_debug.sh evaluate_debug.sh
DIV2K-Val.zip, DRealSR.zip, RealSR.zip) from Hugging Face or PKU Disk../testset/, ensuring the structure:
./testset/DIV2K-Val/LR/xxx.png
./testset/DIV2K-Val/HR/xxx.png
./testset/DRealSR/LR/xxx.png
./testset/DRealSR/HR/xxx.png
./testset/RealSR/LR/xxx.png
./testset/RealSR/HR/xxx.png
net_params_200.pkl) from the same link and place it in ./weight/../test_debug.sh for convenience):
python test.py --LR_dir=path_to_LR_images --SR_dir=path_to_SR_images
The results will be saved in path_to_SR_images../testset/xxx/.--LR_dir=./testset/xxx/ --SR_dir=./yyy/, and the model will perform x4 super-resolution.Run the evaluation script (or modify and execute ./evaluate_debug.sh for convenience):
python evaluate.py --HR_dir=path_to_HR_images --SR_dir=path_to_SR_images
This repo provides code for Stage 2 training (adversarial distillation). For Stage 1 (pretraining the channel-pruned VAE decoder), refer to our paper and use the code of Latent Diffusion Models repo.
DAPE.pth, halfDecoder.ckpt, osediff.pkl, ram_swin_large_14m.pth) from Hugging Face or PKU Disk, and place them in ./weight/pretrained/.config.yml:
dataroot_gt: path_to_HR_images_of_LSDIR
./train.sh or ./train_debug.sh):
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python -m torch.distributed.run --nproc_per_node=8 --master_port=23333 train.py
The trained model will be saved in ./weight/.This project is built upon the codes of Latent Diffusion Models, Diffusers, BasicSR, and OSEDiff. We sincerely thank the authors of these repos for their significant contributions.
If you find our work helpful, please consider citing:
@inproceedings{chen2025adversarial,
title={Adversarial Diffusion Compression for Real-World Image Super-Resolution},
author={Chen, Bin and Li, Gehui and Wu, Rongyuan and Zhang, Xindong and Chen, Jie and Zhang, Jian and Zhang, Lei},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
year={2025}
}
74 commits
Python
99.8%
(CVPR 2025) Adversarial Diffusion Compression for Real-World Image Super-Resolution [PyTorch]
290
stars
74
commits
Python
primary language
Apr 5, 2025
updated
Bin Chen1,3,* | Gehui Li1,* | Rongyuan Wu2,3,* | Xindong Zhang3 | Jie Chen1,† | Jian Zhang1,† | Lei Zhang2,3
1 School of Electronic and Computer Engineering, Peking University
2 The Hong Kong Polytechnic University, 3 OPPO Research Institute
* Equal Contribution. † Corresponding Authors.
⭐ If AdcSR is helpful to you, please star this repo. Thanks! 🤗
https://github.com/user-attachments/assets/1211cefa-8704-47f5-82cd-ec4ef084b9ec
git clone https://github.com/Guaishou74851/AdcSR.git
cd AdcSR
conda create -n AdcSR python=3.10
conda activate AdcSR
pip install --upgrade pip
pip install -r requirements.txt
chmod +x train.sh train_debug.sh test_debug.sh evaluate_debug.sh
DIV2K-Val.zip, DRealSR.zip, RealSR.zip) from Hugging Face or PKU Disk../testset/, ensuring the structure:
./testset/DIV2K-Val/LR/xxx.png
./testset/DIV2K-Val/HR/xxx.png
./testset/DRealSR/LR/xxx.png
./testset/DRealSR/HR/xxx.png
./testset/RealSR/LR/xxx.png
./testset/RealSR/HR/xxx.png
net_params_200.pkl) from the same link and place it in ./weight/../test_debug.sh for convenience):
python test.py --LR_dir=path_to_LR_images --SR_dir=path_to_SR_images
The results will be saved in path_to_SR_images../testset/xxx/.--LR_dir=./testset/xxx/ --SR_dir=./yyy/, and the model will perform x4 super-resolution.Run the evaluation script (or modify and execute ./evaluate_debug.sh for convenience):
python evaluate.py --HR_dir=path_to_HR_images --SR_dir=path_to_SR_images
This repo provides code for Stage 2 training (adversarial distillation). For Stage 1 (pretraining the channel-pruned VAE decoder), refer to our paper and use the code of Latent Diffusion Models repo.
DAPE.pth, halfDecoder.ckpt, osediff.pkl, ram_swin_large_14m.pth) from Hugging Face or PKU Disk, and place them in ./weight/pretrained/.config.yml:
dataroot_gt: path_to_HR_images_of_LSDIR
./train.sh or ./train_debug.sh):
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python -m torch.distributed.run --nproc_per_node=8 --master_port=23333 train.py
The trained model will be saved in ./weight/.This project is built upon the codes of Latent Diffusion Models, Diffusers, BasicSR, and OSEDiff. We sincerely thank the authors of these repos for their significant contributions.
If you find our work helpful, please consider citing:
@inproceedings{chen2025adversarial,
title={Adversarial Diffusion Compression for Real-World Image Super-Resolution},
author={Chen, Bin and Li, Gehui and Wu, Rongyuan and Zhang, Xindong and Chen, Jie and Zhang, Jian and Zhang, Lei},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
year={2025}
}
74 commits
Python
99.8%