AST
Adapt or Perish: Adaptive Sparse Transformer with Attentive Feature Refinement for Image Restoration
Install / Use
/learn @joshyZhou/ASTREADME
Adapt or Perish: Adaptive Sparse Transformer with Attentive Feature Refinement for Image Restoration (CVPR 2024)
Shihao Zhou, Duosheng Chen, Jinshan Pan, Jinglei Shi, and Jufeng Yang
News
- Jul 16, 2025: Hugging Face Demo is available now, thanks contribution of congcong
- Feb 27, 2024: AST has been accepted to CVPR 2024 :tada:
Package dependencies
The project is built with PyTorch 1.9.0, Python3.7, CUDA11.1. For package dependencies, you can install them by:
pip install -r requirements.txt
Training
Derain
To train AST on SPAD, you can run:
sh script/train_derain.sh
Dehaze
To train AST on Densehaze, you can run:
sh script/train_dehaze.sh
Raindrop
To train AST on AGAN, you can run:
sh script/train_raindrop.sh
Evaluation
To evaluate AST, you can run:
sh script/test.sh
For evaluate on each dataset, you should uncomment corresponding line.
Results
Experiments are performed for different image processing tasks including, rain streak removal, raindrop removal, and haze removal. Here is a summary table containing hyperlinks for easy navigation:
<table> <tr> <th align="left">Benchmark</th> <th align="center">Pretrained model</th> <th align="center">Visual Results</th> </tr> <tr> <td align="left">SPAD</td> <td align="center"><a href="https://pan.baidu.com/s/1uqsXeztA55ny8vnQHfxmlA?pwd=h68m">(code:h68m)</a></td> <td align="center"><a href="https://pan.baidu.com/s/1KtAWESp3mzfrV4qy7BLaWg?pwd=wqdg">(code:wqdg)</a></td> </tr> <tr> <td align="left">AGAN</td> <td align="center"><a href="https://pan.baidu.com/s/1obhEpvWLV9FLF47FMcNX7g?pwd=astt">(code:astt)</a></td> <td align="center"><a href="https://pan.baidu.com/s/1VewSQl6c7uWHpfCDVQeW4g?pwd=astt">(code:astt)</a></td> </tr> <tr> <td align="left">Dense-Haze</td> <td align="center"><a href="https://pan.baidu.com/s/1PeSaf-ZRwnMBjlNHGEkvzg?pwd=astt">(code:astt)</a></td> <td align="center"><a href="https://pan.baidu.com/s/18JK8hQFLzSuiVZyianmJQw?pwd=astt">(code:astt)</a></td> </tr> </table>Citation
If you find this project useful, please consider citing:
@inproceedings{zhou2024AST,
title={Adapt or Perish: Adaptive Sparse Transformer with Attentive Feature Refinement for Image Restoration},
author={Zhou, Shihao and Chen, Duosheng and Pan, Jinshan and Shi, Jinglei and Yang, Jufeng},
booktitle={CVPR},
year={2024}
}
Acknowledgement
This code borrows heavily from Uformer.
