# rust-postprocessor — plugins ViON

Source : https://vionvision.tech/fr/plugins/cameras/rust-postprocessor

Native Rust detection post-processing of VION (NMS, IoU, merge, object tracking, line crossing and zone filtering)

- Paquet : @vionvision/rust-postprocessor
- Groupe: Caméras et enregistrement
- Version: 0.1.14
- Licence: MIT
- https://npm.vionvision.tech/-/web/detail/@vionvision/rust-postprocessor
- https://github.com/atva0408-create/Vion-platform/tree/main/rust-postprocessor#readme

## Description technique

Native Rust detection post-processing of VION — NMS, IoU, box merging, a multi-class IoU + Kalman object tracker (`CameraWorld`), line-crossing events and zone filtering.

Built with [napi-rs](https://napi.rs) — ships prebuilt binaries for Linux x64 and arm64 (glibc) and Windows x64, the platforms of VION, so there is no compile step on install.

## Installation

```bash
npm install @vionvision/rust-postprocessor --registry https://npm.vionvision.tech
```

## Usage

```ts
import { CameraWorld, merge, nms } from '@vionvision/rust-postprocessor';

// Greedy non-maximum suppression (per label), normalized [0,1] boxes
const kept = nms(detections, 0.5);

// Cluster nearby/overlapping same-label boxes into union boxes
const merged = merge(detections, 0.5, 0.02);

// The world of one camera: tracks with stable ids across frames, line crossings, zones and privacy masks
const world = new CameraWorld();
world.setLines(lines, 16 / 9);
world.setZones(zones);
const { tracked, crossings, events } = world.ingest(Date.now(), detections);
```

Also exposes `nmsIndices`, `boxIou`, `filterIndices` (which detections the zones keep), confidence thresholds
(`setMinConfidence`, `setMinConfidences`), `attest` and `notifyCameraMove`. See `index.d.ts` for the full, documented
API.

## Development

```bash
npm install
npm run build        # release build (napi build --platform --release)
npm run build:debug  # debug build
npm run lint         # cargo clippy + eslint
```

---

Built and published by VION from atva0408-create/Vion-platform (`packaging/napi/build.sh`), from the code of the camera.ui author.
