sudo apt-get update
sudo apt-get dist-upgrade
sudo apt install libopenblas-dev libblas-dev m4 cmake cython python3-dev python3-yaml python3-setuptools
sudo apt-get install libavutil-dev libavcodec-dev libavformat-dev libswscale-dev
sudo apt install libopenblas-dev libblas-dev m4 cmake cython
sudo python3.7 -m pip install numpy pyyaml cython
cd /home/pi/zjf
sudo python3.7 -m pip install torch-1.7.0a0-cp37-cp37m-linux_armv7l.whl
sudo python3.7 -m pip install torchvision-0.8.0a0+45f960c-cp37-cp37m-linux_armv7l.whl
sudo apt-get install python3-matplotlib
sudo apt-get install libatlas-base-dev
sudo python3.7 -m pip install --target=/usr/lib/python3/dist-packages numpy
sudo apt-get install build-essential git cmake pkg-config -y
sudo apt-get install libjpeg8-dev -y
sudo apt-get install libtiff5-dev -y
sudo apt-get install libjasper-dev -y
sudo apt-get install libpng12-dev -y
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev -y
sudo apt-get install libgtk2.0-dev -y
sudo apt-get install libatlas-base-dev gfortran -y
sudo python3.7 -m pip install opencv-python
sudo apt-get install libjpeg-dev
sudo python3.7 -m pip install --target=/usr/lib/python3/dist-packages pillow
sudo python3.7 -m pip install --target=/usr/lib/python3/dist-packages pyyaml
sudo python3.7 -m pip install --target=/usr/lib/python3/dist-packages scipy
sudo apt-get install libhdf5-serial-dev
sudo python3.7 -m pip install --target=/usr/lib/python3/dist-packages h5py
sudo python3.7 -m pip install --target=/usr/lib/python3/dist-packages scipy
sudo python3.7 -m pip install --target=/usr/lib/python3/dist-packages keras
sudo python3.7 -m pip install tensorflow-2.4.0-cp37-none-linux_armv7l.whl
sudo python3.7 -m pip install -U --ignore-installed wrapt enum34 simplejson netaddr
sudo python3.7 -m pip install --target=/usr/local/lib/python3.7/dist-packages tensorflow-2.4.0-cp37-none-linux_armv7l.whl
sudo python3.7 -m pip install tqdm
出现numpy问题,解决命令如下:
sudo python3.7 -m pip uninstall numpy
sudo python3.7 -m pip install --upgrade numpy
运行YOLO代码命令:
python3.7 detect.py --source ./inference/images/ --weights weights/yolov5s.pt --conf 0.4
参考链接
https://blog.csdn.net/m0_46295742/article/details/113181193
https://blog.csdn.net/m0_46295742/article/details/112967918
https://blog.csdn.net/qq_39501363/article/details/90666520