当前位置:网站首页>ncnn神經網絡計算框架在香柳丁派OrangePi 3 LTS開發板中的使用介紹
ncnn神經網絡計算框架在香柳丁派OrangePi 3 LTS開發板中的使用介紹
2022-07-03 12:39:00 【H('ω')M】


1、 騰訊 ncnn 源碼下載命令如下所示
1) 第一種方法:下載 Orang Pi 百度雲盤中提供的 ncnn.tar.gz 壓縮包
a) 從下面的百度雲盤鏈接可以下載 ncnn.tar.gz 源碼壓縮包。進入 ncnn 文 件夾中就能看到

b) 下載完 ncnn.tar.gz 壓縮包後,首先將 ncnn.tar.gz 上傳到開發板 linux 系 統中
c) 然後使用下面的命令解壓 ncnn.tar.gz

2) 第二種方法:使用 git 命令直接下載源碼,但是如果不會解决開發板訪問 github 的問題,是很難下載成功的。如果訪問 github 沒有問題,建議使用這 種方法,因為這種方式可以保證代碼是最新的。

2、然後安裝依賴包

3、然後開始編譯,ncnn 編譯命令如下所示

說明:在沒有任何散熱措施的情况下,在開發板上直接編譯 ncnn 大約需要 15 分鐘, 請耐心等待編譯完成。如果有加風扇來給開發板降溫,速度應該會更快些。
4、ncnn 中有一些測試示例,比如 squeezenet 測試命令和結果如下所示

5、benchncnn 可以用來測試神經網絡的推理性能,測試方法如下所示
1) 編譯生成的 benchncnn 可執行文件在如下路徑中,注意下面的命令執行路 徑為 ncnn 源碼的頂層目錄

2) 首先需要將 benchncnn 複制到 benchmark 目錄中

3) benchncnn 的使用方法如下所示

4) benchncnn 使用 cpu 測試結果如下所示

a) Debian Bullseye Linux5.16 服務器版本系統測試結果

6、NanoDet 是一個速度超快和輕量級的移動端 Anchor-free 目標檢測模型。測試方 法如下所示
1)編譯生成的 nanodet 可執行文件在如下路徑中,注意下面的命令執行路徑為 ncnn 源碼上一級目錄

2) 首先新建一個 nanodet_demo 的文件夾

3) 然後將編譯生成的 nanodet 可執行程序複制到 nanodet_demo 文件夾中

4)然後需要下載 nanodet 模型文件並上傳到 nanodet_demo 文件夾中
a) nanodet 模型文件下載地址如下所示

b) 打開上面的鏈接,找 nanodet_m.bin 和 nanodet_m.param 這兩個文件, 然後下載下來,再上傳到開發板 Linux 系統的 nanodet_demo 文件夾中

c) 此時 nanodet_demo 文件夾中應該有了下面的三個文件

5)然後還需要將想檢測的圖片放在 nanodet_demo 文件夾中,比如下面這張有 很多車的圖片(可以使用手機拍幾張車流或者動物的圖片)

6) 然後運行下面的命令就可以使用 nanodet 進行目標檢測,car.jpg 請替換成 你的圖片的名字

7)檢測完成的結果會保存在名為 image.png 的圖片中

8) 如果使用的是桌面版的 Linux 系統,可以直接打開 image.png 查看,如果使 用的是服務器版本的 Linux 系統,可以將 image.png 拷貝到電腦中查看, image.png 內容如下圖所示,可以看到識別到的物體左上角會顯示物體的種 類和可信度的百分比

7、為了方便測試benchncnn和 nanodet,我整理了一份只包含benchncnn和 nanodet的可執行文件以及測試需要的模型文件打包成一個 ncnn_test_demo.tar.gz 壓縮包放 在百度雲盤上面了,不需要下載編譯 ncnn 的源碼,使用這份可執行程序就可以直 接開始測試了
1)從下面的百度雲盤鏈接可以下載 ncnn_test_demo.tar.gz 壓縮包。進入 ncnn 文件夾中就能看到

2)下載完 ncnn_test_demo.tar.gz 壓縮包後,首先將 ncnn_test_demo.tar.gz 壓 縮包上傳到開發板 linux 系統中
3)然後使用下面的命令解壓 ncnn_test_demo.tar.gz

4) 解壓後進入 ncnn_test_demo 目錄可以看到其中包含 benchncnn_demo 和 nanodet_demo 兩個子文件夾,它們分別用來測試 benchncnn 和 nanodet

5) 進入 benchncnn_demo 文件夾,然後運行./benchncnn 4 $(nproc) 0 -1 這個命 令就可以直接測試神經網絡的推理性能

6)進入 nanodet_demo 文件夾,然後運行./nanodet car.jpg 這個命令就可以直 接使用 nanodet 來檢測 car.jpg 圖片中的物體了,你也可以將想要檢測的圖 片放在 nanodet_demo 文件夾中,然後使用 nanodet 來檢測

边栏推荐
- Adult adult adult
- Sword finger offer06 Print linked list from end to end
- Using swift language features, write a pseudo-random number generator casually
- ES6 standard
- The future of cloud computing cloud native
- 写一个简单的nodejs脚本
- Lambda表达式
- Bert running error: attributeerror: module'tensorflow contrib. tpu' has no attribute 'InputPipelineConfig'
- Prompt unread messages and quantity before opening chat group
- 347. Top k high frequency elements
猜你喜欢

Prompt unread messages and quantity before opening chat group

剑指Offer09. 用两个栈实现队列

Swagger

Use bloc to build a page instance of shutter

Take you to the installation and simple use tutorial of the deveco studio compiler of harmonyos to create and run Hello world?

Integer int compare size

剑指Offer06. 从尾到头打印链表

If you can't learn, you have to learn. Jetpack compose writes an im app (II)

公纵号发送提示信息(用户微服务--消息微服务)

Idea packages the web project into a war package and deploys it to the server to run
随机推荐
Using swift language features, write a pseudo-random number generator casually
Take you to the installation and simple use tutorial of the deveco studio compiler of harmonyos to create and run Hello world?
Official website of Unicode query
If you can't learn, you have to learn. Jetpack compose writes an im app (II)
Oh my Zsh + TMUX installation
01_ Using the concurrent tool class library, is thread safety safe
在网上炒股开户可以吗?资金安全吗?
LeetCode 0556. Next bigger element III - end of step 4
2.6 preliminary cognition of synergetic couroutines
257. All paths of binary tree
Summary of error prone knowledge points: Calculation of define s (x) 3*x*x+1.
Swift return type is a function of function
Flutter 退出登录二次确认怎么做才更优雅?
242. Effective letter heteronyms
02_ Lock the code, and don't let the "lock" become a worry
ORM use of node -serialize
Enable SASL authentication for memcached
Eureka self protection
Kubectl_ Command experience set
Adult adult adult