Repository navigation
Conversation
… presets models/person/model.onnx: the CPU person detector majestic uses on cameras without an NPU. QDQ int8, MobileNetV1-0.25 with an FPN-lite head, 66.7k parameters, 320x192 YUV in. engine/: majestic's int8 engine for it, in C with NEON. It runs the model from an NV21 crop, matches the reference arithmetic (tools/pdq.py) bit for bit, and takes the detection heads to float from their accumulators. On a Hi3516EV300 it takes 37.2 ms per crop, against 64.7 ms for the TVM build it replaces. scripts/build.sh, which the release workflow runs: - exports the blob; - checks the host and ARM NEON builds against the reference on 40 crops, every value identical, and that the ARM build finds the host's boxes on all 3000; - measures the presets on 3000 labelled COCO val2017 crops: F1-optimal for balanced, the F0.5 optimum for fewerFalseAlarms, recall 0.90 or the F2 optimum for catchEverything. Two local runs gave byte-identical outputs.
PR Summary by QodoAdd the person detector, NEON engine, and measured release pipeline
AI Description
Diagram
High-Level Assessment
Files changed (16)
|
Code Review by Qodo
1.
|
From review: a reused output directory let previously extracted files, or crops from another run, into the checks and the measurement, though the archives had passed their hashes. The archives are now extracted fresh each build, and crops.py refuses a directory that already holds crops. The outputs are unchanged.
The CPU person detector majestic uses on cameras without an NPU, and the engine that runs it, replacing majestic's TVM build. The model is
models/person/model.onnx: QDQ int8, MobileNetV1-0.25 with an FPN-lite head, 66.7k parameters.Engine (
engine/pdnet.c)C with NEON. It reads the 320×192 NV21 crop directly, keeps int8 activations with per-channel weights, and requantizes with a single rounding. The detection heads go straight from their int32 accumulators to float. The int8 graph's own output range caps the stride-8 confidence at a score of 0.5, in steps of about one logit, and taking the accumulators avoids that.
Same model and crops, compared on 3000 labelled COCO crops:
Release (
scripts/build.sh, run byrelease.ymlby hand only)person.pdnet(84 KB).tools/pdq.py) on 40 crops: all six head maps, every value identical. The ARM build, run under qemu-arm for correctness only, must also find exactly the host's boxes on all 3000 crops.It publishes
person.pdnet,person.json(thresholds per preset),points.mdandSHA256SUMS. Two local runs produced byte-identical outputs.Preset rule: balanced is the F1 optimum; fewerFalseAlarms is the F0.5 optimum, per the decision to use F0.5 for all models; catchEverything is recall ≥ 0.90, else the F2 optimum.