Pytorch_yoloV5预测数据-非结构数据结构化


前置条件

 配置好环境后不用修改代码。即可实现,实时目标检测多达80种物

离线的情况

   下载yoloV5的代码
  01.下载网络上的模型
  02.  在detect 所在的文件夹下,创建 weights ,并把模型放在这个位置
     ./weights
  03.执行代码
     python detect.py --weights ./weights/yolov5s.pt --source ./data/images/ --classes 5 --save-txt --save-crop
  
  04.查看预测的结果
     即save_txt以及save_conf等,将这两个参数设置为True后,能在预测的文件里面找到中心坐标以及置信度了
	 runs/detect/exp3/labels

修改类别

  python detect.py --weights ./weights/yolov5s.pt --source ./data/images/ --classes 0 1 2 3 5 7 9 11 12 --save-txt --save-crop
  
  
  说明:  YOLOv5s、YOLOv5m、YOLOv5l、YOLOv5x 按照其所含的残差结构的个数依次增多,网络的特征提取、融合能力不断加强,检测精度得到提高,但相应的时间花费也在增加

自定义类别进行训练

 YOLO 格式的数据集

参考

  https://github.com/ultralytics/yolov5/releases