/HyFluid

Official code for Inferring Hybrid Neural Fluid Fields from Videos (NeurIPS 2023)

Primary LanguagePython

Inferring Hybrid Neural Fluid Fields from Videos

This is the official code for Inferring Hybrid Neural Fluid Fields from Videos (NeurIPS 2023).

teaser

[Paper] [Project Page]

Installation

Install with conda:

conda env create -f environment.yml
conda activate hyfluid

or with pip:

pip install -r requirements.txt

Data

The demo data is available at data/ScalarReal. The full ScalarFlow dataset can be downloaded here.

Quick Start

To learn the hybrid neural fluid fields from the demo data, firstly reconstruct the density field by running (~40min):

bash scripts/train.sh

Then, reconstruct the velocity field by jointly training with the density field (~15 hours on a single A6000 GPU.):

bash scripts/train_j.sh

Finally, add vortex particles and optimize their physical parameters (~40min):

bash scripts/train_vort.sh

The results will be saved in ./logs/exp_real. With the learned hybrid neural fluid fields, you can re-simulate the fluid by using the velocity fields to advect density:

bash scripts/test_resim.sh

Or, you can predict the future states by extrapolating the velocity fields:

bash scripts/test_future_pred.sh

Citation

If you find this code useful for your research, please cite our paper:

@article{yu2023inferring,
  title={Inferring Hybrid Neural Fluid Fields from Videos},
  author={Yu, Hong-Xing and Zheng, Yang and Gao, Yuan and Deng, Yitong and Zhu, Bo and Wu, Jiajun},
  journal={NeurIPS},
  year={2023}
}