Inference example
This folder demonstrates how to run FuXi-CFD ONNX inference end-to-end:
- load raw inputs (
data/inputs.npz) - normalize + resample to model input grid
- run ONNX with onnxruntime
- de-normalize model outputs back to physical scale
Run
python scripts/infer.py \
--model ../model/fuxicfd_model.onnx \
--input data/inputs.npz \
--output data/prediction.npz
Input format
data/sample_input.npy stores a Python dict (load with allow_pickle=True) containing:
u_100m, v_100m: shape(9, 9)dem, roughness: shape(301, 301)
The final model input tensor is built as (4, 300, 300) with channel order:
[u_100m, v_100m, dem, roughness]
Output format
data/prediction.npz contains u, v, w, k, each of shape (27, 300, 300).
Normalization
See normalization/README.md for exact variable orders and shapes.