赞
踩
# 下载官方SDK230501
wget https://sophon-file.sophon.cn/sophon-prod-s3/drive/23/06/15/16/Release_230501-public.zip
unzip Release_230501-public.zip
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu cmake
## 创建并指定空的依赖文件夹socsdk
cd Release_230501-public/
mkdir -p soc-sdk
export socsdk=/home/hhhh/Documents/sophon/Release_230501-public/soc-sdk # 需要根据自己的实际绝对路径进行修改
echo $socsdk
# ------/Release_230501-public/libsophon_20230605_025400/
cd libsophon_20230605_025400/
tar -zxf libsophon_0.4.8_aarch64.tar.gz
cp -rf libsophon_0.4.8_aarch64/opt/sophon/libsophon-0.4.8/lib ${socsdk}
cp -rf libsophon_0.4.8_aarch64/opt/sophon/libsophon-0.4.8/include ${socsdk}
# ------/Release_230501-public/sophon-mw_20230605_032400/
cd ../sophon-mw_20230605_032400/
tar -zxf sophon-mw-soc_0.6.3_aarch64.tar.gz
cp -rf sophon-mw-soc_0.6.3_aarch64/opt/sophon/sophon-ffmpeg_0.6.3/lib/ ${socsdk}
cp -rf sophon-mw-soc_0.6.3_aarch64/opt/sophon/sophon-ffmpeg_0.6.3/include/ ${socsdk}
cp -rf sophon-mw-soc_0.6.3_aarch64/opt/sophon/sophon-opencv_0.6.3/lib ${socsdk}
cp -rf sophon-mw-soc_0.6.3_aarch64/opt/sophon/sophon-opencv_0.6.3/include ${socsdk}
# qemu环境的搭建和arm64下依赖的构建 qemu安装依赖的过程中可能会出现问题
# qemu的安装环境 ------/Release_230501-public/rootfs
cd ..
sudo apt-get install -y qemu-user-static debootstrap
#在rootfs文件夹下安装了基于arm64架构的根文件系统
mkdir rootfs && cd rootfs
# qemu中的系统版本为20.04
sudo qemu-debootstrap --arch=arm64 focal .
## 进入qemu虚拟环境,以aarch64 架构的模拟环境运行 /bin/bash
sudo chroot . qemu-aarch64-static /bin/bash
## 进入qemu 后,安装libeigen3-dev、libgflags-dev、libgoogle-glog-dev、libexiv2-dev
sudo apt-get install -y software-properties-common
sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install -y libeigen3-dev libgflags-dev libgoogle-glog-dev libexiv2-dev
## 退出qemu环境
exit
# 设置环境变量
export rootfs=/home/hhhh/Documents/sophon/Release_230501-public/rootfs
export socsdk=/home/hhhh/Documents/sophon/Release_230501-public/soc-sdk
# 复制并填充依赖文件
## libgoogle-glog-dev
sudo cp -rf ${rootfs}/usr/lib/aarch64-linux-gnu/libglog* ${socsdk}/lib
sudo cp -rf ${rootfs}/usr/include/glog ${socsdk}/include
## libgflags-dev
sudo cp -rf ${rootfs}/usr/lib/aarch64-linux-gnu/libgflags* ${socsdk}/lib
sudo cp -rf ${rootfs}/usr/include/gflags ${socsdk}/include
## libexiv2-dev
sudo cp -rf ${rootfs}/usr/lib/aarch64-linux-gnu/libexiv2* ${socsdk}/lib
sudo cp -rf ${rootfs}/usr/include/exiv2 ${socsdk}/include
## libeigen3-dev
sudo cp -rf ${rootfs}/usr/include/eigen3 ${socsdk}/include
# pipeline-demo编译
cd ../sophon-pipeline_20230605_080800/
tar -xzvf sophon-pipeline_v0.3.7_c9b37f7_20230605.tar.gz
cd sophon-pipeline_v0.3.7_c9b37f7_20230605/
## 编译代码
./tools/compile.sh soc ${socsdk}
更多说明文件路径:./Release_230501-public/sophon-pipeline_20230605_080800
需要copy到开发板上:
修改cameras_yolov5.json
cd ${SOPHON_PIPELINE_YOLOV5}
# 增加文件权限
chmod +x yolov5s_demo
# ./soc/yolov5s_demo --help 查看命令行帮助信息
# 以arm SoC 1684x yolov5s模型为例。若需要使用 本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/酷酷是懒虫/article/detail/842765
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。