# Nightfield sky segmentation

Nightfield runs the sky mask on the device. Its worker loads the model and
runtime from this site when a live camera view needs a mask.

## Sky model

The model is the EGE-UNet sky segmentation checkpoint published by
[xiongzhu666](https://github.com/xiongzhu666/Sky-Segmentation-and-Post-processing)
under the [MIT License](./LICENSE.txt). Nightfield converts the published
parameter and weight files to ONNX for browser inference. The input is
384 × 384 RGB and the output is the model's final sky probability.

To reproduce the conversion, use scripts/convert-sky-model.py in the source
repository with EGE_165.ncnn.param, EGE_165.ncnn.bin, then the output path as
arguments. The input SHA-256 values are:

| File | SHA-256 |
| --- | --- |
| EGE_165.ncnn.param | 3262aeb9f3f819a108e5a1875ea693cbfa255fdcccdae35c86e496c54a2d4f7f |
| EGE_165.ncnn.bin | 1e7477fafe35023bdde237d18f0b3db66d7466fd162546ca0846ff3fc0c1b806 |

## Browser runtime

The WebAssembly runtime comes from the official
[onnxruntime-web 1.23.2 npm distribution](https://www.npmjs.com/package/onnxruntime-web/v/1.23.2).
See the [runtime license](../ort/LICENSE.txt) and
[third-party notices](../ort/ThirdPartyNotices.txt).
