技术专栏
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个
手气红包
暂无数据
相关专栏
-
浏览量:1128次2024-01-19 20:54:02
-
浏览量:1501次2023-12-29 17:03:02
-
浏览量:3786次2022-10-11 15:31:51
-
浏览量:2373次2022-10-12 09:31:53
-
浏览量:679次2024-01-16 18:03:56
-
浏览量:1030次2024-01-10 14:39:54
-
浏览量:1546次2023-03-29 17:15:23
-
浏览量:4235次2022-09-26 09:49:49
-
浏览量:5491次2022-09-23 09:10:47
-
浏览量:2330次2023-03-29 16:55:16
-
2022-09-16 15:24:48
-
浏览量:14071次2022-09-15 15:54:04
-
浏览量:629次2024-01-18 17:18:51
-
浏览量:1449次2024-01-10 15:17:17
-
浏览量:2124次2024-01-05 14:11:13
-
浏览量:2622次2024-05-23 13:45:40
-
浏览量:2635次2023-08-29 13:13:38
-
浏览量:4061次2020-09-24 11:13:20
-
浏览量:729次2024-01-02 09:46:50
置顶时间设置
结束时间
删除原因
-
广告/SPAM
-
恶意灌水
-
违规内容
-
文不对题
-
重复发帖
打赏作者
圈圈虫
您的支持将鼓励我继续创作!
打赏金额:
¥1
¥5
¥10
¥50
¥100
支付方式:
微信支付
打赏成功!
感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
审核成功
发布时间设置
发布时间:
请选择发布时间设置
是否关联周任务-专栏模块
审核失败
失败原因
请选择失败原因
备注
请输入备注