Skip to content

xmnpu-models: v5, and each model's preset thresholds beside it - #2569

Merged
widgetii merged 1 commit into
masterfrom
xmnpu-models-v5
Oct 11, 2026
Merged

widgetii merged 1 commit into
masterfrom
xmnpu-models-v5

Conversation

@widgetii

Copy link
Copy Markdown
Member

Pins OpenIPC/xmnpu-models v5 and installs each model's <name>.json next to its .xmm in /usr/share/majestic/npu, on NAND builds only, as before.

The .json holds, per class (human, vehicle, animal), the thresholds behind majestic's three object-detection presets: fewer false alarms, balanced, and catch everything. majestic reads the file beside the model it loads. The thresholds are measured by the v5 release on all of COCO val2017, from the int8 model, on the frames the camera gives it. The release notes carry the precision, recall and F1 each preset achieves.

Evidence

  • Model output unchanged: on a GK7205V510's NPU, v5's yolov8n produces the same detections as v4's (1337 of 1337 on 20 frames). The bytes differ only in host-memory fields, which v5's build now sanitizes reproducibly.
  • Thresholds match hardware: for yolov8n, all nine equal those measured on the GK7205V510's own NPU over the same 5000 frames. For yolov8s, eight of nine match; the ninth is one step off (vehicle catch-everything, 0.06 against 0.05) on a flat F2 optimum.
  • Local build, gk7205v500_ultimate:
    • all four files pass the hash check;
    • both .json files are in rootfs.ubifs under /usr/share/majestic/npu;
    • rootfs.ubi is 28.4 MiB, the same as with v4, under the 32 MiB limit.

v5 publishes, with each model, <name>.json: per class, the thresholds
behind majestic's object-detection presets (fewer false alarms, balanced,
catch everything). They are measured by the release on all of COCO
val2017 from the int8 model, on the frames the camera hands it. majestic
reads the file beside the model, so it is installed next to each .xmm.
For yolov8n, all nine thresholds equal those measured on a GK7205V510's
NPU over the same 5000 frames.

The models' outputs are unchanged from v4: on the GK7205V510's NPU, v5's
yolov8n gives the same detections as v4's (1337 of 1337 on 20 frames).
Their bytes differ only in the host-memory fields v5's sanitizer now
handles reproducibly.

Built locally for gk7205v500_ultimate: all four files hash-verified, the
two .json installed in /usr/share/majestic/npu beside the models, and
rootfs.ubi at 28.4 MiB, the same as with v4.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Pin xmnpu-models v5 and install model-specific preset thresholds

✨ Enhancement ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Pin the v5 YOLOv8 models and verify both models and their threshold files against release hashes.
• Install each model’s preset thresholds beside its .xmm for majestic to read on NAND builds only.
• Preserve the existing NAND-only packaging; reported local checks found unchanged detections and
 image size.
Diagram

graph TD
  Release["v5 release assets"] --> Package["Buildroot package"] --> Image[("NAND UBIFS")] --> Directory["NPU model directory"] --> Majestic["majestic npuDetect"]
  Hashes["SHA256 hashes"] --> Package
Loading
High-Level Assessment

Keep the model-specific JSON files beside their matching models: this matches majestic’s existing lookup behavior and retains the NAND-only packaging boundary. Embedding thresholds elsewhere would require a different runtime lookup without a clear benefit.

Files changed (2) +11 / -6

Enhancement (1) +6 / -3
xmnpu-models.mkDownload and install v5 models with adjacent presets +6/-3

Download and install v5 models with adjacent presets

• Pins the package to v5 and downloads both JSON files alongside the '.xmm' models. Extends the existing UBIFS installation hook to place all four files in '/usr/share/majestic/npu', leaving the NAND-only behavior intact.

general/package/xmnpu-models/xmnpu-models.mk

Other (1) +5 / -3
xmnpu-models.hashVerify all four v5 release assets +5/-3

Verify all four v5 release assets

• Replaces the v4 model checksums with v5 checksums and adds SHA-256 entries for both model-specific JSON preset files.

general/package/xmnpu-models/xmnpu-models.hash

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can tweak Display settings with a live preview to see your comment before it ships

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@widgetii
widgetii merged commit 2061035 into master Oct 11, 2026
30 of 31 checks passed
@widgetii
widgetii deleted the xmnpu-models-v5 branch October 11, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant