Files

21 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# RDK X5 YOLOv26n 量化
输入模型为 `../best.onnx`,固定输入 `images [1,3,640,640]`opset 11。流程参考
`D-Robotics/rdk_model_zoo``rdk_x5` 分支中 `ultralytics_yolo26` 示例:
- `extract_yolo26_bpu.py` 移除 TopK、Gather 和最终检测结果组装,只输出三尺度
`(cls, box)` 原始特征,输出布局为 NHWC。
- 校准数据从 `../../dataset` 均匀抽取 50 张图片,直接 resize 到 640x640保存
RGB/CHW/float32`data_scale=1/255` 由量化配置完成。
- 板端输入为 NV12量化默认 int8并使用官方 Softmax int8 优化项。
执行 `./quantize_x5.sh` 会在 Docker 镜像
`openexplorer/ai_toolchain_ubuntu_20_x5_cpu:v1.2.8` 中依次运行 `hb_mapper checker`
`hb_mapper makertbin`,产物为
`mapper_output_bpu/best_bpu_bayese_640x640_nv12.bin`。部署端需要按三尺度输出完成
sigmoid、LTRB 解码、阈值筛选和 NMS可直接复用 `postprocess_yolo26.py`
板端输入是 NV12模型输出顺序为 `cls_s8, box_s8, cls_s16, box_s16,
cls_s32, box_s32`,输出张量布局是 NHWC。`.bin``model_info` 应以板端
`hrt_model_exec` 实际显示的名称和量化参数为准。