surroundings
- windows 10 64bit
- python 3.8.11
- torch-1.7.1+cu101
foreword
On the evening of August 17th, Beijing time, YOLOv5
officially released the v6.2
version. Compared with v6.1 , this update added classification training, verification, inference and export of other model formats ImageNet
The training model of YOLOv5m-cls
, ResNet18
, ResNet34
, ResNet50
, ResNet101
series and EfficientNet
( b0
, b1
, b2
, b3
) models, the classification workflow is consistent with the original target detection workflow, which can greatly reduce the learning cost.
renew
Here are some important update points listed
- The export of classification models, perfectly supports
tensorflow
,keras
,tflite
,tf.js
, usingpython export.py --include saved_model pb tflite tfjs
- Integrate
ClearML
, it is a machine learning suite, official website address: https://clear.ml/ - Integrate
deci.ai
, which is a model optimization tool, very simple and effective to use, official website address: https://deci.ai/ -
utils/benchmarks.py
script supportsGPU
output performance parameters - For single-card training in
torch
versions greater than 1.12.0, the parameter--seed
has been added -
MPS(Metal Performance Shader)
support for Apple notebookM1
andM2
,--device mps
practice
Download the source code from the link https://github.com/ultralytics/yolov5/archive/refs/tags/v6.2.zip , then unzip and enter the source code directory
Download the classification model from https://github.com/ultralytics/yolov5/releases/download/v6.2/yolov5s-cls.pt and put it in the source directory
(pytorch1.7) PS D:\Github\ yolo v5-6.2> python classify/predict.py --weights yolo v5s-cls.pt --source data/images/bus.jpg classify\predict: weights=[' yolo v5s-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
Convert the classification model to other formats, this version supports batch export, such as
python export.py --weights yolo v5s-cls.pt resnet50.pt efficientnet_b0.pt --include onnx engine --img 224
The above is the model that converts yolov5s-cls.pt
, resnet50.pt
and efficientnet_b0.pt
into onnx
and tensorrt
at the same time, which is really convenient
Remark
In the version release notes, the author glenn jocher
also mentioned that the function of instance segmentation will be added in the subsequent v6.3
version, and in v7.0
released at the end of the year, the three major object detection, classification and instance segmentation will be updated. The architecture of the model, let’s look forward to it together. The full version release notes can be found at https://github.com/ultralytics/yolov5/releases/tag/v6.2
References
This article is reprinted from https://xugaoxiang.com/2022/08/19/yolov5-v6-2/
This site is for inclusion only, and the copyright belongs to the original author.