DeminYu98 / DiffCast

[CVPR 2024] Official implementation of "DiffCast: A Unified Framework via Residual Diffusion for Precipitation Nowcasting"
GNU General Public License v3.0
55 stars 7 forks source link

DiffCast-CVPR2024

Official implementation of "DiffCast: A Unified Framework via Residual Diffusion for Precipitation Nowcasting"

Introduction

DiffCast is a precipitation nowcasting framework based on diffusion model and a deterministic predictive backbone, which can be achieved with various spatio-temporal predictive models optimized with deterministic loss (e.g., SimVP, Earthformer, ConvGRU, PhyDNet et al).

This repository contains the part of training and inference code for using DiffCast to make predictions (5 --> 20) on SEVIR datasets.

Other pulbic datasets in our paper are preprocessed with h5 files. Feel free to concat me (deminy@stu.hit.edu.cn,deminyu98@gmail.com) if you have any questions about code or datasets.

Code

Environment

conda env create -f env.ymal
conda activate diffcast
Optional Accelerate Env We apply the `HuggingFace Accelerator` in our code to utilize multi-gpus. One can config the accelerator env before runing code. - config the accelerate: `accelerate config` - apply accelerate to run code: `accelerate launch *.py`

Resource

pretrained DiffCast_PhyDNet: GooleDrive

Toy prediction visiualization

We give some demos from SEVIR to easily check the predictive performance of DiffCast_PhyDNet. Before that, you need to download the pretrained checkpoint and put it in resources/

python sample_batch.py

Evaluation

# Note: Config the dataset path in `dataset/get_dataset.py` before running.
python run.py --backbone phydnet --use_diff --eval --ckpt_milestone resources/diffcast_phydnet_sevir128.pt  

Backbone Training

python run.py --backbone simvp

You can check the experimental configuration by

python run.py -h

Acknowledgement

We refer to implementations of the following repositories and sincerely thank their contribution for the community:

Citation

@inproceedings{Yu2024diffcast,
  title={DiffCast: A Unified Framework via Residual Diffusion for Precipitation Nowcasting},
  author={Demin Yu and Xutao Li and Yunming Ye and Baoquan Zhang and Chuyao Luo and Kuai Dai and Rui Wang and Xunlai Chen},
  booktitle={The IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year={2024}
}