Skip to content

Latest commit

 

History

History
319 lines (234 loc) · 21.3 KB

README_EN.md

File metadata and controls

319 lines (234 loc) · 21.3 KB

YOLOAir : Make the improvement of the YOLO model faster, more convenient

English | 简体中文

The YOLOAir algorithm library is a combination toolbox of a series of YOLO detection algorithms based on PyTorch. Used to combine different modules to build different networks.

✨Built-in model network structures such as YOLOv5, YOLOv7, YOLOX, YOLOR, Transformer, Scaled_YOLOv4, YOLOv3, YOLOv4, YOLO-Facev2, TPH-YOLOv5, YOLOv5Lite, PicoDet (continuously updated🚀)...

✨Module componentization: Help users customize and quickly combine Backbone, Neck, Head, diversify network models, help scientific research improve detection algorithms, model improvements, and network permutation and combination 🏆. Build powerful network models.

✨Unified model code framework, unified application method, unified parameter adjustment, unified improvement, easy module combination, and more powerful network model building.


██╗   ██╗ ██████╗ ██╗      ██████╗      █████╗     ██╗    ██████╗ 
╚██╗ ██╔╝██╔═══██╗██║     ██╔═══██╗    ██╔══██╗    ██║    ██╔══██╗
 ╚████╔╝ ██║   ██║██║     ██║   ██║    ███████║    ██║    ██████╔╝
  ╚██╔╝  ██║   ██║██║     ██║   ██║    ██╔══██║    ██║    ██╔══██╗
   ██║   ╚██████╔╝███████╗╚██████╔╝    ██║  ██║    ██║    ██║  ██║
   ╚═╝    ╚═════╝ ╚══════╝ ╚═════╝     ╚═╝  ╚═╝    ╚═╝    ╚═╝  ╚═╝

✨Based on the YOLOv5 code framework, and synchronously adapt to the stable YOLOv5_v6.1 update, synchronize the v6.1 deployment ecosystem. Before using this project, you can learn about the YOLOv5 library.


Features🚀Usage🍉Documentation📒issues🌟News💪

support

Project address: https://github.com/iscyy/yoloair


Main features🚀

🚀 Support more YOLO series algorithm model improvements (continuous update...)

The YOLOAir algorithm library summarizes a variety of mainstream YOLO series detection models, and a set of codes integrates multiple models:

  • Built-in integrated YOLOv5 model network structure, YOLOv7 model network structure, YOLOR model network structure, YOLOX model network structure, Scaled_YOLOv4 model network structure, YOLOv4 model network structure, YOLOv3 model network structure, YOLO-FaceV2 model network structure, TPH-YOLOv5 model network structure The structure, YOLOv5-Lite model network structure, PicoDet model network structure, etc. are continuously updated...

The above multiple detection algorithms use a unified model code framework, which is integrated in the YOLOAir library, with a unified task form and a unified application method. 🌟It is convenient for researchers to improve the algorithm model of the paper, compare models, and realize the diversification of network combinations. including lightweight models and models with higher accuracy, which can be reasonably selected according to the scene, and achieve a balance between accuracy and speed. 🌟the library supports decoupling of different structures and module components to make modules componentized. By combining different module components, users can customize and build different detection models according to different data sets or different business scenarios.

🔥🔥🔥 Heavy! ! ! As a supplement to the open source project of the attention mechanism, a 6300+ 🌟Star attention mechanism algorithm code base is strongly recommended 👉External-Attention-pytorch,The summary is very comprehensive, including various Attention, Self-Attention and other codes. The code is concise and easy to read, and one line of code implements the Attention mechanism. Welcome everyone to play!


🚀Support loading the official pre-training weights of YOLOv3, YOLOv4, YOLOv5, YOLOv7, YOLOR and other networks for transfer learning

🚀 Support more Backbone

  • CSPDarkNet series
    ResNet series
    RepBlock series
    ShuffleNet series
    Ghost series
    MobileNet series
    ConvNext series
    RepLKNet series
    RegNet series
    EfficientNet series
    Transformer series
    CNN and Transformer, etc.
    Continuously updated 🎈

🚀 Support more Necks

  • The neck includes mainstream structures such as FPN, PANet, and BiFPN. Continuously updated 🎈

🚀Support more detection heads

  • YOLOv4、YOLOv5 Head、
  • YOLOR Implicit Head、
  • YOLOX Decoupled Head、DetectX Head
  • Adaptively Spatial Feature Fusion Head(ASFF)、
  • YOLOv7 IAuxDetect Head, IDetect Head;

🚀Support for more plug-and-play attention mechanisms

  • Plug-and-play use of attention mechanisms anywhere in the network
    Self Attention
    Contextual Transformer
    Bottleneck Transformer
    S2-MLP Attention
    SK Attention
    CBAM Attention
    SE Attention
    Coordinate attention
    NAM Attention
    GAM attention
    ECA Attention
    Shuffle Attention
    DANet Attention and other mainstream attention mechanisms

🚀Support for more IoU loss functions

  • Loss functions such as CIoU, DIoU, GIoU, EIoU, SIoU, alpha IOU, etc.

🚀 More spatial pyramid pooling structures

  • SPP / SPPF / ASPP / RFB / SPPCSPC, etc.

🚀Support more NMS

  • NMS、Merge-NMS、DIoU-NMS、Soft-NMS、CIoU_NMS、DIoU_NMS、GIoU_NMS、EIoU_NMS、SIoU_NMS、Soft-SIoUNMS、Soft-CIoUNMS、Soft-DIoUNMS、Soft-EIoUNMS、Soft-GIoUNMS, etc.

🚀Support for more data augmentation

  • Mosaic、Copy paste、Random affine(Rotation, Scale, Translation and Shear)、MixUp、Augment HSV(Hue, Saturation, Value、Random horizontal flip

🚀Support more Loss

  • ComputeLoss、ComputeNWDLoss、ComputeLoss(X)、ComputeLoss(v6)、ComputeLossAuxOTA(v7)、ComputeLossOTA(v7), etc.

🚀Supports Anchor-base and Anchor-Free

🚀Supports Weighted Box Fusion (WBF)

🚀 Built-in multiple network model modular components

The above component modules use a unified model code framework, unified task form, and unified application method. Module componentization🚀 can help users customize and quickly combine Backbone, Neck, and Head, diversify network models, and help scientific research improve detection algorithms. Build stronger network models.

Built-in network model configuration support ✨

🚀Including yaml configuration of YOLOv3, YOLOv4, Scaled_YOLOv4, YOLOv5, YOLOv7, YOLOX, YOLOR, Transformer, YOLO-FaceV2, PicoDet, YOLOv5-Lite, TPH-YOLOv5 ** other algorithm models such as improved network structure** File Summary (Recommended 🌟🌟🌟🌟🌟)

News! ingishvcn

Support SPD-Conv✅
Support HorNet Network ✅
Support ConvNext module ✅
🔥Add the difference of YOLOv3, YOLOv4, YOLOv5, YOLOv7, Scaled-YOLOv4 network pre-training weight link 🔗
Updating...


Usage🍉

About the code. Follow the design principle of YOLOv5.
The original version was created based on YOLOv5(v6.1)

Install

Clone repo and install requirements.txt in a Python>=3.7.0 environment, including PyTorch>=1.7.

$ git clone https://github.com/iscyy/yoloair.git
$ cd yoloair
$ pip install -r requirements.txt

Training

$ python train.py --data coco128.yaml --cfg configs/yolov5/yolov5s.yaml

Inference

detect.py runs inference on a variety of sources, saving results to runs/detect.

$ python detect.py --source 0  # webcam
                          img.jpg  # image
                          vid.mp4  # video
                          path/  # directory
                          path/*.jpg  # glob

fusion

If you use different models to infer on the dataset, you can use the wbf.py file to integrate the results via weighted box fusion. You just need to set img path and txt path in wbf.py file.

$ python wbf.py

Performance

Model size
(pixels)
mAPval
0.5:0.95
mAPval
0.5
Speed
CPU b1
(ms)
Speed
V100 b1
(ms)
Speed
V100 b32
(ms)
params
(M)
FLOPs
@640 (B)
YOLOv5n 640 28.0 45.7 45 6.3 0.6 1.9 4.5
YOLOv5s 640 37.4 56.8 98 6.4 0.9 7.2 16.5
YOLOv5m 640 45.4 64.1 224 8.2 1.7 21.2 49.0
YOLOv5l 640 49.0 67.3 430 10.1 2.7 46.5 109.1
YOLOv5x 640 50.7 68.9 766 12.1 4.8 86.7 205.7
YOLOv5n6 1280 36.0 54.4 153 8.1 2.1 3.2 4.6
YOLOv5s6 1280 44.8 63.7 385 8.2 3.6 12.6 16.8
YOLOv5m6 1280 51.3 69.3 887 11.1 6.8 35.7 50.0
YOLOv5l6 1280 53.7 71.3 1784 15.8 10.5 76.8 111.4
YOLOv5x6
+ TTA
1280
1536
55.0
55.8
72.7
72.7
3136
-
26.2
-
19.4
-
140.7
-
209.8
-
Expand
  • The original version was created based on YOLOv5

Model size
(pixels)
mAPval
0.5:0.95
mAPval
0.5
deconv kernel size
Speed
V100 b1
(ms)
Speed
V100 b32
(ms)
params
(M)
FLOPs
@640 (B)
YOLOv5s 640 33.7 52.9 - 5.6 2.2 7.23 16.5
YOLOv5s-deconv-exp1 640 33.4 52.5 2 5.6 2.4 7.55 18.2
YOLOv5s-deconv-exp2 640 34.7 54.2 4 5.8 2.5 8.54 23.2
Expand
  • The training process depends on 4xV100 GPU
# train
python -m torch.distributed.run --nproc_per_node 4 train.py --device 0,1,2,3 --data data/coco.yaml --hyp data/hyps/hyp.scratch-low.yaml  --cfg path/to/model.yaml --batch 512 --epochs 300 --weights ''
# val
python val.py --verbose --data data/coco.yaml --conf 0.001 --iou 0.65 --batch 1 --weights path/to/model.pt
  • There is a gap between the mAP of YOLOv5s and the official one, here is just for comparison

Model size
(pixels)
mAPval
0.5:0.95
mAPval
0.5
params
(M)
FLOPs
@640 (B)
YOLOv5s 640 37.4 56.6 7.226 16.5
YOLOv5s-deconv 640 37.8 57.1 7.232 16.5
Expand
  • tested the 4x4 depthwise-separable deconv by setting the groups as input_channel
  • their params number and FLOPS are nearly the same while the new model's mAP is about 0.4 higher than the origin.

Model size
(pixels)
mAPval
0.5:0.95
mAPval
0.5
params
(M)
FLOPs
@640 (B)
YOLOv5s 640 37.2 56.0 7.2 16.5
YOLOv5s-C3GC-backbone 640 37.7 57.3 7.5 16.8
Expand
  • The original version was created based on YOLOv5-6.0

YOLO network model specific improvement method tutorial and principle reference

More module improvement explanation tutorials are continuously updated...

YOLOv5 official tutorial ✨

Sync with YOLOv5 framework

Future enhancement ✨

In the future, we will continue to build and improve the YOLOAir ecosystem Improve and integrate more YOLO series models, continue to combine different modules to build more different network models Horizontal expansion and introduction of associative techniques, such as semi-supervised learning, etc. Follow up: YOLO-mask & YOLO-pose


Statement

Expand
  • The content of this site is only for sharing notes. If some content is infringing, please sending email.

  • If you have any question, please discuss with me by sending email.

Acknowledgements

Expand

https://github.com/ultralytics/yolov5
https://github.com/AlexeyAB/darknet
https://github.com/ultralytics/yolov3
https://github.com/WongKinYiu/PyTorch_YOLOv4
https://github.com/WongKinYiu/ScaledYOLOv4
https://github.com/meituan/YOLOv6
https://github.com/WongKinYiu/yolov7
https://github.com/WongKinYiu/yolor
https://github.com/xmu-xiaoma666/External-Attention-pytorch
https://gitee.com/SearchSource/yolov5_yolox
https://github.com/Krasjet-Yu/YOLO-FaceV2
https://github.com/positive666/yolov5_research/
https://github.com/ppogg/YOLOv5-Lite
https://github.com/Gumpest/YOLOv5-Multibackbone-Compression
https://github.com/cv516Buaa/tph-yolov5 Paper:https://arxiv.org/abs/2208.02019