# Segmentation model

`isnet-general-use-int8.onnx` is the IS-Net "general use" background segmentation network, stored with weight-only int8 (QDQ) quantization. Activations and arithmetic stay in float32, so the output matches the float32 model closely while the file is 42 MiB (44,229,662 bytes), well under the 90 MB limit.

- SHA-256: `3b21a6706dc8d6e4ba9f5b31ebc6940f6c785b58862e27bb25daa9dd4424b87f`
- Input `input`: float32 `[1, 3, S, S]`, RGB, each channel `value / 255 - 0.5`. The app uses `S` = 1024 and retries at `S` = 512 if memory runs out; it does not use other sizes.
- Output (first output, `output`): float32 `[1, 1, S, S]` foreground probability in 0..1. The remaining outputs are unused side-stage maps.
- Runs on the bundled onnxruntime-web WebAssembly backend, entirely on the device.

## Provenance and licences

| Step | Author | Licence | File |
| --- | --- | --- | --- |
| IS-Net architecture and DIS training code (`isnet-general-use` weights) | Xuebin Qin et al., "Highly Accurate Dichotomous Image Segmentation" (DIS) | Apache-2.0 | `LICENSE-DIS-Apache-2.0.txt` |
| ONNX export of `isnet-general-use` | rembg, Daniel Gatis | MIT | `LICENSE-rembg-MIT.txt` |
| Repackaged ONNX model | IMG.LY GmbH (`imgly/isnet-general-onnx`) | MIT | `LICENSE-IMGLY-MIT.txt` |
| Weight-only int8 QDQ quantization | `xrds/isnet-general-onnx-int8` | MIT | `LICENSE-IMGLY-MIT.txt` |

All licences are permissive (Apache-2.0 and MIT). The non-commercial RMBG models are not used.

Source files were downloaded once while preparing this repository. The app never downloads anything: the model is loaded from this folder using a relative path.
