File size: 876 Bytes
f798323 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | # 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
```bash
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.
|