Native Rust detection post-processing for the camera.ui ecosystem — NMS, IoU, box merging, a multi-class IoU + Kalman object tracker, line-crossing events and zone filtering.
Built with napi-rs — ships prebuilt binaries for Linux (glibc/musl), macOS, Windows and FreeBSD across x64, arm64 and riscv64, so there is no compile step on install.
npm install @camera.ui/rust-postprocessorimport { nms, merge, ObjectTracker } from '@camera.ui/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);
// Stateful multi-class tracker with stable track ids across frames
const tracker = new ObjectTracker({ iouThreshold: 0.3, hitCounterMax: 15 });
const { tracked, crossings } = tracker.update(detections, Date.now());Also exposes nmsIndices, boxIou, and tracker configuration for crossing
lines (setLines), detection zones / privacy masks (setZones), confidence
thresholds and ReID. See index.d.ts for the full, documented API.
npm install
npm run build # release build (napi build --platform --release)
npm run build:debug # debug build
npm run lint # cargo clippy + eslintPart of the camera.ui ecosystem - A comprehensive camera management solution.