参考:https://blog.csdn.net/m0_46410698/article/details/120390460
安装1)安装torch
树莓派torch安装这个版本的
2)安装cv2
pip3 install opencv-python
3)下载yolov5和权重
git cone https://github.com/ultralytics/yolov5.git
wget https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5s.pt
运行测试python3 detect.py
运行后结果保存在yolov5/runs/detect/exp下
***摄像头
python3 detect.py --source 0
报错:
File "detect.py", line 186, in run
if isinstance(vid_writer[i], cv2.VideoWriter):
TypeError: isinstance() arg 2 must be a type or tuple of types
解决:
这行错误代码更改成
if isinstance(vid_writer[i], type(cv2.VideoWriter)):
然后再运行就行了,速度感人3秒。。。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)