1、传输文件
前面是本地地址后面是ubuntu地址
文件传输完毕后可以先查看有没有miniconda
conda env list
没有miniconda就可以执行下面这个命令下载miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
修改权限 sudo chmod 777 Miniconda3-latest-Linux-x86_64.sh
2、新建虚拟环境
conda activate car
查看新建虚拟环境
3、退出重新连接ubuntu
下载python版本以3.9为例
conda create -n car python==3.9
进入car虚拟环境
conda activate car
查看 python的版本
pip -V
运行python detector.py 下载一系列的包加镜像源版 列如cv2执行下面这条命令
pip install opencv-python==4.5.1.48 -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
以cup运行代码为例需要修改test.py路径,添加 ,map_location=torch.device('cpu')
先退出虚拟环境
4、在次进入虚拟环境
运行 python detector.py就实现视频监控功能。