1. 硬件环境
- Hailo-8 AI计算卡,专为边缘计算人工智能应用设计,提供高达26 TOPS的计算能力。
- LKD3588
其他Neardi产品也可参考此配置。
2. 硬件连接
接入Hailo-8算力棒
添加Hailo-8散热片
3. 软件版本
2023/10月后固件版本默认支持hailo8,烧录Neardi-3588最新固件下载与支持找到对应型号,烧录方法请参阅《使用Type-C线升级固件》一章。
查看固件版本:
neardi@LPA3588:~$ cat /etc/os-release | grep BUILD_NAME
BUILD_NAME="LZ160_3588_ubuntu20.04_v1.0_20240205_1439"
4. 人脸识别和属性检测
克隆hailo8_ak_rockit代码库:
git clone https://gitee.com/ytlans/hailo8_ak_rockit
源码目录结构如下:
neardi@LPA3588:~/hailo8/hailo8_ak_rockit$ ls -al
total 6036
drwxrwxr-x 5 neardi neardi 4096 Mar 1 06:36 .
drwxrwxr-x 4 neardi neardi 4096 Mar 1 06:36 ..
-rwxrwxr-x 1 neardi neardi 3065744 Mar 1 06:36 ak_rockit_demo
drwxrwxr-x 2 neardi neardi 4096 Mar 1 06:36 ak_rockit_demo_res
drwxrwxr-x 8 neardi neardi 4096 Mar 1 06:36 .git
-rw-rw-r-- 1 neardi neardi 59371 Mar 1 06:36 hailort.log
-rwxrwxr-x 1 neardi neardi 69784 Mar 1 06:36 libgraphic_lsf.so
-rwxrwxr-x 1 neardi neardi 2950456 Mar 1 06:36 librockit.so
drwxrwxr-x 2 neardi neardi 4096 Mar 1 06:36 model
-rw-rw-r-- 1 neardi neardi 0 Mar 1 06:36 README.md
-rwxrwxr-x 1 neardi neardi 43 Mar 1 06:36 run_demo.sh
运行Demo:
neardi@LPA3588:~/hailo8/hailo8_ak_rockit$ ./run_demo.sh
该Demo对16路1080P@30fps的H265视频流进行分析,成功执行后的画面如下:
注意: 如果在终止Demo进程后出现黑屏,重新插拔HDMI线即可恢复显示。
5.从摄像头读取视频并进行分析
克隆hailo8_yolo5_demo代码库:
sudo apt update
git clone https://gitee.com/ytlans/hailo8_yolo5_demo
源码目录结构如下:
neardi@LPA3588:~/hailo8/hailo8_yolo5_demo$ ls -al
total 6280
drwxrwxr-x 8 neardi neardi 4096 Mar 1 06:42 .
drwxrwxr-x 5 neardi neardi 4096 Mar 1 06:41 ..
drwxrwxr-x 3 neardi neardi 4096 Mar 1 06:42 Apps
drwxrwxr-x 8 neardi neardi 4096 Mar 1 06:42 .git
-rwxrwxr-x 1 neardi neardi 1065 Mar 1 06:42 LICENSE
drwxrwxr-x 4 neardi neardi 4096 Mar 1 06:42 MultiNetworkPipeline
drwxrwxr-x 2 neardi neardi 4096 Mar 1 06:42 Network
-rwxrwxr-x 1 neardi neardi 828 Mar 1 06:42 README.md
-rwxrwxr-x 1 neardi neardi 6387928 Mar 1 06:42 runme.4.14.0
drwxrwxr-x 2 neardi neardi 4096 Mar 1 06:42 SampledData
drwxrwxr-x 5 neardi neardi 4096 Mar 1 06:42 Utils
安装编译环境:
sudo apt update
sudo apt install build-essential cmake
编译Demo:
neardi@LPA3588:~/hailo8/hailo8_yolo5_demo/Apps/yolo$ ./build.sh
-I- Building aarch64
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc
-- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
......
[100%] Linking CXX executable runme.4.14.0
[100%] Built target runme.4.14.0
将编译生成的可执行文件复制到Apps/yolo目录:
neardi@LPA3588:~/hailo8/hailo8_yolo5_demo/Apps/yolo$ cp runme.4.14.0 ../../
运行Demo:
neardi@LPA3588:~/hailo8/hailo8_yolo5_demo/Apps/yolo$ ./runme.4.14.0 -b 1 -n "yolov5s" -v "/dev/video22"
成功执行后的画面如下:
6. 参考链接
注册成功后详细文档如下: