【米尔边缘AI计算盒FZ5测评】开发板目标分类demo
<div class='showpostmsg'><p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"><span style="font-family:宋体">上电启动前需要先将网线和</span>USB<span style="font-family:宋体">线连接至</span>PC<span style="font-family:宋体">,对于网线其有两种连接方式:一种是通过路由器连接,另一种是直连</span>PC<span style="font-family:宋体">,这里我们选择了直连</span>PC<span style="font-family:宋体">的方式。首先修改电脑的静态</span>IP<span style="font-family:宋体">地址:</span></span></span></span></p><p align="center" style="text-align:center; text-indent:24.0pt"></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"><span style="font-family:宋体">然后打开一个串口终端,设置波特率为</span>115200<span style="font-family:宋体">,注意串口的流控功能需要关闭:</span></span></span></span></p>
<p align="center" style="text-align:center; text-indent:24.0pt"></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"><span style="font-family:宋体">然后串口会打印开发板的启动信息:</span></span></span></span></p>
<p style="text-indent:24.0pt; text-align:justify"></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"><span style="font-family:宋体">上图展示了开发板的核心芯片为</span>XCZU5EV<span style="font-family:宋体">,并且我们拿到的为</span>DRAM<span style="font-family:宋体">为</span>4GB<span style="font-family:宋体">的版本,等待系统启动成功后,会进入系统的登录界面:</span></span></span></span></p>
<p style="text-indent:24.0pt; text-align:justify"></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"><span style="font-family:宋体">登录用户名和登录密码均为</span>root<span style="font-family:宋体">,可以看到已经成功进入命令行界面,下面可以简单试一下基本功能:</span></span></span></span></p>
<p align="center" style="text-align:center; text-indent:24.0pt"></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"><span style="font-family:宋体">可以看到功能</span>OK<span style="font-family:宋体">,同时可以看到开发板的</span>IP<span style="font-family:宋体">地址为</span>192.168.1.254<span style="font-family:宋体">。下面试一试</span>SSH<span style="font-family:宋体">的连接模式,首先新建一个终端:</span></span></span></span></p>
<p style="text-indent:24.0pt; text-align:justify"></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"><span style="font-family:宋体">登录用户及密码同样均为</span>root<span style="font-family:宋体">,此时我们不但可以看到终端还可以看见,板卡的文件系统。下面来跑一下官方的</span>demo<span style="font-family:宋体">,官方的</span>demo<span style="font-family:宋体">有两个,一个是分类,另一个是目标检测。先跑分类的吧,首先打开</span>resnet50<span style="font-family:宋体">的模型配置文件:</span></span></span></span></p>
<p style="text-indent:24.0pt; text-align:justify"></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"><span style="font-family:宋体">可以看到了其定义了模型路径,标签和输入图像的尺寸等信息,参数的具体介绍如下所示:</span></span></span></span></p>
<p style="text-indent:24.0pt; text-align:justify"></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"><span style="font-family:宋体">然后准备运行推理模型:</span></span></span></span></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"><span style="font-family:宋体">挂载驱动:</span></span></span></span></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif">insmod /home/root/workspace/driver/fpgadrv.ko</span></span></span></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"><span style="font-family:宋体">然后运行如下代码,编译工程:</span></span></span></span></p>
<pre>
<code>cd /home/root/workspace/PaddleLiteSample/classification
// 如果没有build目录,创建一个
mkdir build
cd build
rm -rf *
// 调用cmake 创建 Makefile
cmake ..
// 编译工程。
make</code></pre>
<p style="text-indent:24.0pt; text-align:justify"></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"><span style="font-family:宋体">编译成功后进入</span>CMakeFiles<span style="font-family:宋体">文件夹,运行:</span></span></span></span></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif">./image_classify ../configs/resnet50/drink.json </span></span></span></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"><span style="font-family:宋体">上述命令是使用</span>resnet50<span style="font-family:宋体">网络进行目标检测,检测结果为:</span></span></span></span></p>
<p style="text-indent:24.0pt; text-align:justify"></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"><span style="font-family:宋体">检测的图片为:</span></span></span></span></p>
<p align="center" style="text-align:center; text-indent:24.0pt"></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"><span style="font-family:宋体">可以看到确实为怡宝矿泉水,并且置信度为</span>99%<span style="font-family:宋体">,我们修改一下图片路径,检测的图片为:</span></span></span></span></p>
<p align="center" style="text-align:center; text-indent:24.0pt"></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"><span style="font-family:宋体">重新检测的结果为:</span></span></span></span></p>
<p style="text-indent:24.0pt; text-align:justify"></p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"><span style="font-family:宋体">可以看到确实为可口可乐,并且置信度为</span>99%<span style="font-family:宋体">。本次测评实现了开发板上电及目标分类,下次将尝试目标检测和其他更多功能。</span></span></span></span><span style="font-size:12pt"><span style="line-height:150%"><span style="font-family:"Times New Roman",serif"> </span></span></span></p>
<p style="text-indent:24.0pt; text-align:justify"> </p>
<p style="text-indent:24.0pt; text-align:justify"> </p>
</div><script> var loginstr = '<div class="locked">查看本帖全部内容,请<a href="javascript:;" style="color:#e60000" class="loginf">登录</a>或者<a href="https://bbs.eeworld.com.cn/member.php?mod=register_eeworld.php&action=wechat" style="color:#e60000" target="_blank">注册</a></div>';
if(parseInt(discuz_uid)==0){
(function($){
var postHeight = getTextHeight(400);
$(".showpostmsg").html($(".showpostmsg").html());
$(".showpostmsg").after(loginstr);
$(".showpostmsg").css({height:postHeight,overflow:"hidden"});
})(jQuery);
} </script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script> <p>官方的demo分类和目标检测有什么区别</p>
<p>用那个demo都一样么</p>
火辣西米秀 发表于 2021-3-13 19:11
官方的demo分类和目标检测有什么区别
用那个demo都一样么
<p>分类是说一个图片是什么类别,目标检测是指出目标的位置和类别,目标检测难度更大。</p>
zzx1997 发表于 2021-3-13 21:39
分类是说一个图片是什么类别,目标检测是指出目标的位置和类别,目标检测难度更大。
<p>原来这样,感谢楼主的回答</p>
<p>谢谢分享!</p>
<p>这个图片是系统自带的吗?还是你自己导入的?</p>
<p> </p>
页:
[1]