README.md
March 30, 2026 Β· View on GitHub
DiffCR: A Fast Conditional Diffusion Framework for Cloud Removal from Optical Satellite Images
This repository is the official PyTorch implementation of the TGRS 2024 paper DiffCR.

Requirements
To install dependencies:
pip install -r requirements.txt
To download datasets:
-
Sen2_MTC_Old: multipleImage.tar.gz
-
Sen2_MTC_New: CTGAN.zip
-
SEN12MS-CR: https://mediatum.ub.tum.de/1554803
Training
To train the models in the paper, run these commands:
python run.py -p train -c config/ours_sigmoid.json
Testing
To test the pre-trained models in the paper, run these commands:
python run.py -p test -c config/ours_sigmoid.json
Evaluation
To evaluate my models on two datasets, run:
python evaluation/eval.py -s [ground-truth image path] -d [predicted-sample image path]
Pretrained Model Weights
You can download pretrained models here:
- DiffCR trained on Sen2_MTC_Old dataset: π€ HuggingFace
- DiffCR trained on Sen2_MTC_New dataset: π€ HuggingFace
- DiffCR trained on SEN12MS-CR dataset (based on the official open-source implementation of UnCRtainTS): π€ HuggingFace
Visualization
The visualization results of 12 methods (including DiffCR) on the test sets of Sen2_MTC_Old and Sen2_MTC_New datasets, along with evaluation code for direct comparison by researchers, are available at: π€ HuggingFace Visualization
βββ paper-report.png β reference metrics table from the paper
β
βββ data/
β βββ Sen2_MTC_New/
β β βββ GT/ β 687 cloud-free ground-truth images ({id}.png)
β β βββ inputs/ β 687 Γ 3 cloudy input images
β β ({id}_A1.png {id}_A2.png {id}_A3.png)
β βββ Sen2_MTC_Old/
β βββ GT/ β 313 ground-truth images
β βββ inputs/ β 313 Γ 3 cloudy inputs
β
βββ results/
β βββ Sen2_MTC_New/
β β βββ ae/ β prediction images for each method ({id}.png)
β β βββ crtsnet/
β β βββ ctgan/
β β βββ ddpmcr/
β β βββ diffcr/ β DiffCR [Ours]
β β βββ dsen2cr/
β β βββ mcgan/
β β βββ pix2pix/
β β βββ pmaa/
β β βββ stgan/
β β βββ stnet/
β β βββ uncrtaints/
β βββ Sen2_MTC_Old/
β βββ (same 12 methods)
β
βββ eval/
βββ metrics.py β PSNR / SSIM / FID / LPIPS evaluation
βββ plot.py β comparison figure generation
βββ requirements.txt β Python dependencies
Citation
If you use our code or models in your research, please cite with:
@ARTICLE{diffcr,
author={Zou, Xuechao and Li, Kai and Xing, Junliang and Zhang, Yu and Wang, Shiying and Jin, Lei and Tao, Pin},
journal={IEEE Transactions on Geoscience and Remote Sensing},
title={DiffCR: A Fast Conditional Diffusion Framework for Cloud Removal From Optical Satellite Images},
year={2024},
volume={62},
number={},
pages={1-14},
}
Acknowledgments
Janspiry/Palette-Image-to-Image-Diffusion-Models