QT开发及YOLOv5环境搭建
该环境部署教程针对ARM架构的英伟达Jetson开发板
文章目录
1 换源
首先进行换源操作,开发系统是ubuntu18.04
步骤:
-
备份原来的sorce文件:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
-
修改sources.list文件:
sudo vim /etc/apt/sources.list
-
删除sources.list中文件内容,并将下列内容添加进sources.list
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic main restricted deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates main restricted deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic universe deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates universe deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic multiverse deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates multiverse deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security main restricted deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security universe deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security multiverse
-
更新源:
sudo apt upgrade
2 opencv安装
opencv默认自带,不需要安装
sudo apt install libopencv-dev
opencv库安装在以下路径:
-
库路径
/usr/lib/aarch64-linux-gnu
-
头文件路径
/usr/include/opencv4
3 QT下载与安装
使用apt-get install
之前更新下,输入命令sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install qt4-dev-tools qt4-doc qt4-qtconfig qt4-demos qt4-designer qtcreator
4 python运行环境部署
4.1 Archiconda安装
-
github.com/Archiconda/build-tools/releases
可下载脚本文件自动安装,也可下载源码自行编译安装 -
chomd 777 Archiconda3-0.2.3-Linux-aarch64.sh ./Archiconda3-0.2.3-Linux-aarch64.sh`
一路默认操作就完事儿,所有选项都yes
4.2 Archiconda换源
vim ~/.condarc
channels:
- https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
- https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- defaults
show_channel_urls: true
4.3 建立yolov5环境
-
打开github找到yolov5的运行环境
github.com/ultralytics/yolov5/blob/master/requirements.txt
-
新建一个yolov5的环境,并且通过requirements安装yolov5所需要的包
conda create -n yolov5 python=3.7 conda activate yolov5 pip install -r requirements.txt