# Perception

Video in, per-frame object tracks out, as an open replacement for a
Metropolis/DeepStream perception pipeline. `praecise-codec` decodes the video
in process, an ONNX detector from `praecise-onnx` (RF-DETR Nano to Large,
Apache-2.0, or D-FINE) runs on every frame on the GPU's execution provider,
and ByteTrack (an independent Rust implementation: Kalman prediction,
two-stage association with low-score detections, minimum-cost assignment)
gives every person and vehicle a stable id, box, score and velocity. With an
image-to-ground homography each track also has a ground position and speed
in metres. Frames can be written as NVIDIA Metropolis `nv.Frame` protobuf
messages, the input Halos Safety Core reads.

```
praecise-track --model rfdetr-medium.onnx --input-size 576 --video in.mp4 --out out/ --nvframe
```

writes `tracks.json`, `summary.json` (frames per second, time per stage,
peak memory) and `frames.nvpb` (one `nv.Frame` per frame, each prefixed by its
length as a varint).
