技术专栏
【爱芯元智】【AX650】【系统】AX650N DEMO 板 NPU 示例说明
背景
通过该文章能初步掌握 AX650N DEMO 板上已 NPU 相关示例及工具,方便开发者快速评估 AX650N NPU 特性。
SDK 版本查询
root@ax650:~# cat /proc/ax_proc/version
Ax_Version V1.54.0
NPU 工具
ax_run_model:用于验证 NPU 工具链编译生成的模型 compiled.axmodel 能否在芯片上正常运行、模型Meta信息、推理耗时等数据。
root@ax650:~# ax_run_model
usage: ax_run_model --model=string [options] ...
options:
-m, --model path to a model file (string)
-r, --repeat repeat times running a model (int [=1])
-w, --warmup repeat times before running a model to warming up (int [=1])
-v, --vnpu type of Visual-NPU inited {0=Disable, 1=STD, 2=BigLittle} (int [=0])
-a, --affinity npu affinity when running a model (int [=1])
-p, --parallel parallel run model using all affinity npu cores (int [=0])
-b, --batch the batch will running (int [=0])
-i, --input-folder the folder of each inputs (folders) located (string [=])
-o, --output-folder the folder of each outputs (folders) will saved in (string [=])
-l, --list the list of inputs which will test (string [=])
--verify verify outputs after running model
--save-benchmark save benchmark result(min, max, avg) as a json file
--inputs-is-folder each time model running needs inputs stored in each standalone input folders
--outputs-is-folder each time model running saved outputs stored in each standalone output folders
--use-tensor-name using tensor names instead of using tensor indexes when loading & saving io files
-?, --help print this message
执行示例
root@ax650:~# ax_run_model -m /opt/data/npu/models/yolov5s.axmodel -w 3 -r 10
Run AxModel:
model: /opt/data/npu/models/yolov5s.axmodel
type: 1 Core
vnpu: Disable
affinity: 0b001
warmup: 3
repeat: 10
batch: { auto: 1 }
parallel: false
pulsar2 ver: 1.2-patch2 7e6b2b5f
engine ver: 2.5.1a
tool ver: 2.2.1
cmm size: 12730188 Bytes
------------------------------------------------------
min = 7.652 ms max = 7.660 ms avg = 7.657 ms
------------------------------------------------------
NPU 示例
SDK 中预置了物体分类示例 sample_npu_classification ,物体检测示例 sample_npu_yolov5s
sample_npu_classification:
root@ax650:~# sample_npu_classification -m /opt/data/npu/models/mobilenetv2.axmodel -i /opt/data/npu/images/cat.jpg
--------------------------------------
model file : /opt/data/npu/models/mobilenetv2.axmodel
image file : /opt/data/npu/images/cat.jpg
img_h, img_w : 224 224
--------------------------------------
topk cost time:0.07 ms
9.5094, 285
9.3773, 282
9.2452, 281
8.5849, 283
7.6603, 287
--------------------------------------
Repeat 1 times, avg time 0.73 ms, max_time 0.73 ms, min_time 0.73 ms
--------------------------------------
sample_npu_yolov5s:
root@ax650:~# sample_npu_yolov5s -m /opt/data/npu/models/yolov5s.axmodel -i /opt/data/npu/images/dog.jpg
--------------------------------------
model file : /opt/data/npu/models/yolov5s.axmodel
image file : /opt/data/npu/images/dog.jpg
img_h, img_w : 640 640
--------------------------------------
post process cost time:2.31 ms
--------------------------------------
Repeat 1 times, avg time 7.66 ms, max_time 7.66 ms, min_time 7.66 ms
--------------------------------------
detection num: 3
16: 91%, [ 138, 218, 310, 541], dog
2: 69%, [ 470, 76, 690, 173], car
1: 56%, [ 158, 120, 569, 420], bicycle
--------------------------------------
声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
红包
4
1
评论
打赏
- 分享
- 举报
评论
0个
手气红包
暂无数据相关专栏
-
浏览量:1414次2025-04-15 17:54:05
-
2025-09-15 15:46:42
-
浏览量:3508次2024-12-08 20:11:51
-
浏览量:3711次2022-07-03 00:53:51
-
浏览量:1790次2024-01-10 14:39:54
-
浏览量:2936次2024-01-19 20:54:02
-
2022-04-01 14:34:37
-
浏览量:9858次2022-03-23 10:50:32
-
浏览量:5988次2022-03-31 11:34:19
-
浏览量:4092次2022-09-03 09:01:25
-
浏览量:2748次2023-12-29 17:03:02
-
浏览量:1587次2024-01-16 18:03:56
-
浏览量:2458次2024-01-10 15:17:17
-
浏览量:463次2025-09-15 14:53:57
-
浏览量:4096次2022-04-01 14:30:05
-
浏览量:4581次2022-10-11 15:31:51
-
浏览量:3107次2022-10-12 09:31:53
-
浏览量:3465次2022-08-02 09:49:57
-
浏览量:1446次2022-09-03 09:01:27
置顶时间设置
结束时间
删除原因
-
广告/SPAM
-
恶意灌水
-
违规内容
-
文不对题
-
重复发帖
打赏作者
圈圈虫
您的支持将鼓励我继续创作!
打赏金额:
¥1
¥5
¥10
¥50
¥100
支付方式:
微信支付
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
审核成功
发布时间设置
发布时间:
请选择发布时间设置
是否关联周任务-专栏模块
审核失败
失败原因
请选择失败原因
备注
请输入备注

微信扫码分享
QQ好友