Converted with Pulsar2 version 7.0.
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.490
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.681
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.528
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.272
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.544
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.697
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.367
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.597
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.648
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.404
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.716
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.873
=== 正式 COCO mAP 结果 ===
原始输出: results/ax/raw_outputs.npz
图数=5000 预测数=1499905
AP@[.5:.95]=0.4896 AP@.5=0.6810 AP@.75=0.5280
AP_small=0.2719 AP_medium=0.5441 AP_large=0.6973
python src/tool/evaluate_rfdetr.py --compare-metrics \
results/onnx/metrics.json results/ax/metrics.json \
--primary -metric 'AP@[0.5:0.95]'
量化精度正式对比
评测集: datasets/annotations_val2017/annotations/instances_val2017.json
图片数: 5000
metric | baseline | quantized | drop
-----------------|-----------|-----------|---------
AP@0.5 | 0.709629 | 0.680995 | 0.028634
AP@0.75 | 0.564776 | 0.528006 | 0.03677
AP@[0.5:0.95] | 0.522527 | 0.489605 | 0.032923
AP_large | 0.723467 | 0.697302 | 0.026165
AP_medium | 0.575634 | 0.544072 | 0.031562
AP_small | 0.312324 | 0.271881 | 0.040443
AR@1 | 0.382697 | 0.366594 | 0.016103
AR@10 | 0.621168 | 0.596892 | 0.024276
AR@100 | 0.672812 | 0.648423 | 0.024389
AR_large | 0.87384 | 0.872696 | 0.001144
AR_medium | 0.73998 | 0.715606 | 0.024374
AR_small | 0.447414 | 0.403977 | 0.043437
prediction_count | 1499568.0 | 1499905.0 | -337.0
# 1. 下载模型
git clone https://huggingface.co/AXERA-TECH/rf-detr-large
cd rf-detr-large
# 2. 从 Hugging Face 下载原始模型、导出并优化 ONNX
python src/tool/export_rfdetr_onnx_hf.py
# 3. 切分 ONNX
python /b2_cut.py \
--input models/rf-detr-large_704_sim.onnx \
--pulsar2-output models/rf-detr-large_704_b2_pulsar2.onnx \
--post-output models/rf-detr-large_704_b2_post.onnx
# 4. 用 pulsar2 编译 rf-detr-large_704_b2_pulsar2.onnx
# 配置:pulsar2_config.json
pulsar2 build --target_hardware AX650 --input rf-detr-large_704_b2_pulsar2.onnx --output_dir output/ --config pulsar2_config.json
# 5. 板端推理(脚本、模型、后处理 ONNX 与图片目录位于同级目录)
python3 b2_infer_axmodel.py \
--axmodel rf-detr-large.axmodel --post-model rf-detr-large_704_b2_post.onnx \
--img-dir coco2017val_5000 --result-dir results/ax
# 6. 开发机 COCO mAP 评测
python src/tool/evaluate_rfdetr.py/ \
--input results/onnx/raw_outputs.npz \
--ann datasets/annotations_val2017/annotations/instances_val2017.json \
--result-dir results/onnx
# 7. 对比 FP32 与量化后的 metrics.json
python src/tool/evaluate_rfdetr.py \
--compare-metrics \
results/onnx/metrics.json results/ax/metrics.json \
--primary-metric 'AP@[0.5:0.95]'