chenydong / PA-Diff

The code of paper "Learning A Physical-aware Diffusion Model Based on Transformer for Underwater Image Enhancement"
Apache License 2.0
20 stars 0 forks source link

PA-Diff

The code of paper :

Learning A Physical-aware Diffusion Model Based on Transformer for Underwater Image Enhancement

Chen Zhao, Chenyu Dong, Weiling Cai

You can find our paper on Arxiv

Framework

Dependencies

Datasets

LSUIUIEBU45|[Realworld Images]()

Prepare dataset:

  1. You should make sure your image size is 256*256
  2. Your directory structure should look like this:
    
    train:
    DatasetName_train_16_256  (16 and 256 are set in config)
    ├── hr_256 (GT images)
    └── sr_16_256 (input images)

test: DatasetName_val_16_256 ├── hr_256 └── sr_16_256


### Test
1. Download our checkpoints from [Baidu Netdisk]()(We will upload our checkpoint after our paper is accepted.)
2. Change "resume_state" in the config file to the path of your checkpoints
3. Change test "dataroot" in the config file to the path like `xxx/DatasetName_val_16_256`
4. Run :` python infer.py`

### Train
1. Change train "dataroot" in the config file to the path like `xxx/DatasetName_train_16_256`
2. Change "resume_state" in the config file to "null"
3. Run :` python train.py`

### Citation

@article{zhao2024learning, title={Learning A Physical-aware Diffusion Model Based on Transformer for Underwater Image Enhancement}, author={Zhao, Chen and Dong, Chenyu and Cai, Weiling}, journal={arXiv preprint arXiv:2403.01497}, year={2024} }