3

YOLOv5 发布 v6.2 正式版

 2 years ago
source link: https://xugaoxiang.com/2022/08/19/yolov5-v6-2/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
  • windows 10 64bit
  • python 3.8.11
  • torch-1.7.1 + cu101

北京时间8月17日晚上,YOLOv5 官方发布了 v6.2 版本,相比 v6.1 ,此次的更新,加入了分类的训练、验证、推理和其它模型格式的导出,分别提供了基于 ImageNet 预训练模型的 YOLOv5m-clsResNet18ResNet34ResNet50ResNet101系列和 EfficientNet (b0b1b2b3) 的模型,分类的工作流与原有的目标检测工作流保持一致,这可以大大减少学习的成本。

这里也将一些重要的更新点罗列一下

  • 分类模型的导出,完美支持 tensorflowkerastflitetf.js,使用 python export.py --include saved_model pb tflite tfjs
  • 整合了 ClearML,它是一个机器学习的套件,官网地址:https://clear.ml/
  • 整合了 deci.ai,它是一个模型优化的工具,使用非常简单有效,官网地址:https://deci.ai/
  • utils/benchmarks.py 脚本支持 GPU输出性能参数
  • torch 版本大于 1.12.0环境下的单卡训练,增加了参数 --seed
  • 苹果笔记本 M1M2MPS(Metal Performance Shader) 支持,--device mps

从链接 https://github.com/ultralytics/yolov5/archive/refs/tags/v6.2.zip 下载源码,然后解压并进入源码目录

https://github.com/ultralytics/yolov5/releases/download/v6.2/yolov5s-cls.pt 下载分类模型,放入源码目录下

(pytorch1.7) PS D:\Github\yolov5-6.2> python classify/predict.py --weights yolov5s-cls.pt --source data/images/bus.jpg
classify\predict: weights=['yolov5s-cls.pt'], source=data/images/bus.jpg, imgsz=224, device=, half=False, dnn=False, project=runs\predict-cls, name=exp, exist_ok=False
YOLOv5  2022-8-17 Python-3.8.11 torch-1.7.1+cu101 CUDA:0 (NVIDIA GeForce GTX 1660, 6144MiB)

Fusing layers...
Model summary: 117 layers, 5447688 parameters, 0 gradients, 11.4 GFLOPs
image 1/1 data/images/bus.jpg: 224x224 minibus 0.44, police van 0.20, amphibious vehicle 0.04, trolleybus 0.04, recreational vehicle 0.03
Speed: 37.6ms pre-process, 3.0ms inference, 7.0ms post-process per image at shape (1, 3, 224, 224)
Saving runs\predict-cls\exp3\bus.jpg
Results saved to runs\predict-cls\exp3
af9bbf7fb916610c.jpg

分类模型转换成其它格式,这个版本支持批量导出,如

python export.py --weights yolov5s-cls.pt resnet50.pt efficientnet_b0.pt --include onnx engine --img 224

上面就是同时将 yolov5s-cls.ptresnet50.ptefficientnet_b0.pt 转换成 onnxtensorrt 的模型,真的是太方便了

在版本发布说明中,作者 glenn jocher 还提到了,后续的 v6.3 版本中将会加入实例分割的功能,而在年底发布的 v7.0 中,将会更新目标检测、分类和实例分割三大模型的架构,让我们一起期待。完整的版本发布说明请见 https://github.com/ultralytics/yolov5/releases/tag/v6.2


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK