Skip to content

Commit

Permalink
update readme and config files for base model
Browse files Browse the repository at this point in the history
  • Loading branch information
Chilicyy committed Nov 4, 2022
1 parent 0e80a64 commit 30b10d2
Show file tree
Hide file tree
Showing 13 changed files with 541 additions and 10 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ YOLOv6-N hits 35.9% AP on COCO dataset with 1234 FPS on T4. YOLOv6-S strikes 43.

## What's New

- Release M/L models and update N/T/S models with enhanced performance.⭐️ [Benchmark](#Benchmark)
- 2x faster training time.
- Fix the degration of performance when evaluating on 640x640 inputs.
- Customized quantization methods. 🚀 [Quantization Tutorial](./tools/qat/README.md)
- [2022.11.04] Release [base models](configs/base/README.md) to simplify the training and deployment process.
- [2022.09.06] Customized quantization methods. 🚀 [Quantization Tutorial](./tools/qat/README.md)
- [2022.09.05] Release M/L models and update N/T/S models with enhanced performance.⭐️ [Benchmark](#Benchmark)
- [2022.06.23] Release N/T/S models with excellent performance.

## Benchmark
| Model | Size | mAP<sup>val<br/>0.5:0.95 | Speed<sup>T4<br/>trt fp16 b1 <br/>(fps) | Speed<sup>T4<br/>trt fp16 b32 <br/>(fps) | Params<br/><sup> (M) | FLOPs<br/><sup> (G) |
Expand Down
10 changes: 5 additions & 5 deletions README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ YOLOv6 提供了一系列面向各种工业应用场景的模型,包括微小

YOLOv6-N 在 COCO 数据集上的 mAP 为 35.9% ,在 T4 显卡推理速度可达 1234 FPS。 YOLOv6-S 的 mAP 为 43.5%,推理速度为 495 FPS ,量化后的 YOLOv6-S 模型在 T4显卡 上的 FPS 可以加速到 869,mAP 为 43.3% 。 YOLOv6-T/M/L 也具有出色的性能,与其他检测器相比,我们的模型在基本相同的推理速度时,可以达到更高的精度。

## 本次更新
## 更新日志

- 发布了 M/L 模型,并且进一步提高了 N/T/S 模型的性能⭐️ [精度指标](#模型指标)
- 将训练速度提高了2倍;
- 修复了 640x640 分辨率推理时性能下降的问题;
- 定制化的模型量化加速方法 🚀 [量化教程](./tools/qat/README.md)
- [2022.11.04] 发布 [基础版模型](configs/base/README_cn.md) 简化训练部署流程。
- [2022.09.06] 定制化的模型量化加速方法 🚀 [量化教程](./tools/qat/README.md)
- [2022.09.05] 发布 M/L 模型,并且进一步提高了 N/T/S 模型的性能 ⭐️ [模型指标](#模型指标)
- [2022.06.23] 发布 N/T/S v1.0 版本模型。

## 模型指标
| 模型 | 输入尺寸 | mAP<sup>val<br/>0.5:0.95 | 速度<sup>T4<br/>trt fp16 b1 <br/>(fps) | 速度<sup>T4<br/>trt fp16 b32 <br/>(fps) | Params<br/><sup> (M) | FLOPs<br/><sup> (G) |
Expand Down
28 changes: 28 additions & 0 deletions configs/base/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## YOLOv6 base model

English | [简体中文](./README_cn.md)

### Features

- Use only regular convolution and Relu activation functions.

- Apply CSP (1/2 channel dim) blocks in the network structure, except for Nano base model.

Advantage:
- Adopt a unified network structure and configuration, and the accuracy loss of the PTQ 8-bit quantization model is negligible, about 0.4%.
- Suitable for users who are just getting started or who need to apply, optimize and deploy an 8-bit quantization model quickly and frequently.

Shortcoming:
- The accuracy on COCO is slightly lower than the v2.0 released models.

### Performance

| Model | Size | mAP<sup>val<br/>0.5:0.95 | Speed<sup>T4<br/>trt fp16 b1 <br/>(fps) | Speed<sup>T4<br/>trt fp16 b32 <br/>(fps) | Params<br/><sup> (M) | FLOPs<br/><sup> (G) |
| :----------------------------------------------------------- | -------- | :----------------------- | -------------------------------------- | --------------------------------------- | -------------------- | ------------------- |
| [**YOLOv6-N-base**](https://github.com/meituan/YOLOv6/releases/download/0.2.1/yolov6n_base.pt) | 640 | 35.6<sup>400e | 832 | 1249 | 4.3 | 11.1 |
| [**YOLOv6-S-base**](https://github.com/meituan/YOLOv6/releases/download/0.2.1/yolov6s_base.pt) | 640 | 43.8<sup>400e | 373 | 531 | 11.5 | 27.6 |
| [**YOLOv6-M-base**](https://github.com/meituan/YOLOv6/releases/download/0.2.1/yolov6m_base.pt) | 640 | 48.8<sup>distill | 179 | 246 | 27.7 | 68.4 |
| [**YOLOv6-L-base**](https://github.com/meituan/YOLOv6/releases/download/0.2.1/yolov6l_base.pt) | 640 | 51.0<sup>distill | 115 | 153 | 58.5 | 144.0 |

- Speed is tested with TensorRT 7.2 on T4.
- The processes of model training, evaluation, and inference are the same as the original ones. For details, please refer to [this README](https://github.com/meituan/YOLOv6#quick-start).
27 changes: 27 additions & 0 deletions configs/base/README_cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## YOLOv6 基础版模型

简体中文 | [English](./README.md)

### 模型特点

- 仅使用常规卷积和Relu激活函数

- 网络结构均采用CSP (1/2通道) block,Nano网络除外。

优势:
- 采用统一的网络结构和配置,且 PTQ 8位量化模型精度损失(约0.4%)较小,适合刚入门或有快速迭代部署8位量化模型需求的用户。

不足:
- COCO上精度对比2.0版本发布模型稍低。

### 模型指标

| 模型 | 输入尺寸 | mAP<sup>val<br/>0.5:0.95 | 速度<sup>T4<br/>trt fp16 b1 <br/>(fps) | 速度<sup>T4<br/>trt fp16 b32 <br/>(fps) | Params<br/><sup> (M) | FLOPs<br/><sup> (G) |
| :----------------------------------------------------------- | -------- | :----------------------- | -------------------------------------- | --------------------------------------- | -------------------- | ------------------- |
| [**YOLOv6-N-base**](https://github.com/meituan/YOLOv6/releases/download/0.2.1/yolov6n_base.pt) | 640 | 35.6<sup>400e | 832 | 1249 | 4.3 | 11.1 |
| [**YOLOv6-S-base**](https://github.com/meituan/YOLOv6/releases/download/0.2.1/yolov6s_base.pt) | 640 | 43.8<sup>400e | 373 | 531 | 11.5 | 27.6 |
| [**YOLOv6-M-base**](https://github.com/meituan/YOLOv6/releases/download/0.2.1/yolov6m_base.pt) | 640 | 48.8<sup>distill | 179 | 246 | 27.7 | 68.4 |
| [**YOLOv6-L-base**](https://github.com/meituan/YOLOv6/releases/download/0.2.1/yolov6l_base.pt) | 640 | 51.0<sup>distill | 115 | 153 | 58.5 | 144.0 |

- 速度是在 T4 上测试的,TensorRT 版本为 7.2;
- 模型训练、评估、推理流程与原来保持一致,具体可参考 [首页 README 文档](https://github.com/meituan/YOLOv6/blob/main/README_cn.md#%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B)
62 changes: 62 additions & 0 deletions configs/base/yolov6l_base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# YOLOv6 large base model
model = dict(
type='YOLOv6l_base',
depth_multiple=1.0,
width_multiple=1.0,
pretrained=None,
backbone=dict(
type='CSPBepBackbone',
num_repeats=[1, 6, 12, 18, 6],
out_channels=[64, 128, 256, 512, 1024],
csp_e=float(1)/2,
),
neck=dict(
type='CSPRepPANNeck',
num_repeats=[12, 12, 12, 12],
out_channels=[256, 128, 128, 256, 256, 512],
csp_e=float(1)/2,
),
head=dict(
type='EffiDeHead',
in_channels=[128, 256, 512],
num_layers=3,
begin_indices=24,
anchors=1,
out_indices=[17, 20, 23],
strides=[8, 16, 32],
iou_type='giou',
use_dfl=True,
reg_max=16, #if use_dfl is False, please set reg_max to 0
distill_weight={
'class': 2.0,
'dfl': 1.0,
},
)
)

solver=dict(
optim='SGD',
lr_scheduler='Cosine',
lr0=0.01,
lrf=0.01,
momentum=0.937,
weight_decay=0.0005,
warmup_epochs=3.0,
warmup_momentum=0.8,
warmup_bias_lr=0.1
)

data_aug = dict(
hsv_h=0.015,
hsv_s=0.7,
hsv_v=0.4,
degrees=0.0,
translate=0.1,
scale=0.9,
shear=0.0,
flipud=0.0,
fliplr=0.5,
mosaic=1.0,
mixup=0.1,
)
training_mode = "conv_relu"
62 changes: 62 additions & 0 deletions configs/base/yolov6l_base_finetune.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# YOLOv6 large base model
model = dict(
type='YOLOv6l_base',
depth_multiple=1.0,
width_multiple=1.0,
pretrained=None,
backbone=dict(
type='CSPBepBackbone',
num_repeats=[1, 6, 12, 18, 6],
out_channels=[64, 128, 256, 512, 1024],
csp_e=float(1)/2,
),
neck=dict(
type='CSPRepPANNeck',
num_repeats=[12, 12, 12, 12],
out_channels=[256, 128, 128, 256, 256, 512],
csp_e=float(1)/2,
),
head=dict(
type='EffiDeHead',
in_channels=[128, 256, 512],
num_layers=3,
begin_indices=24,
anchors=1,
out_indices=[17, 20, 23],
strides=[8, 16, 32],
iou_type='giou',
use_dfl=True,
reg_max=16, #if use_dfl is False, please set reg_max to 0
distill_weight={
'class': 2.0,
'dfl': 1.0,
},
)
)

solver = dict(
optim='SGD',
lr_scheduler='Cosine',
lr0=0.0032,
lrf=0.12,
momentum=0.843,
weight_decay=0.00036,
warmup_epochs=2.0,
warmup_momentum=0.5,
warmup_bias_lr=0.05
)

data_aug = dict(
hsv_h=0.0138,
hsv_s=0.664,
hsv_v=0.464,
degrees=0.373,
translate=0.245,
scale=0.898,
shear=0.602,
flipud=0.00856,
fliplr=0.5,
mosaic=1.0,
mixup=0.243,
)
training_mode = "conv_relu"
62 changes: 62 additions & 0 deletions configs/base/yolov6m_base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# YOLOv6 medium/large base model
model = dict(
type='YOLOv6m_base',
depth_multiple=0.80,
width_multiple=0.75,
pretrained=None,
backbone=dict(
type='CSPBepBackbone',
num_repeats=[1, 6, 12, 18, 6],
out_channels=[64, 128, 256, 512, 1024],
csp_e=float(1)/2,
),
neck=dict(
type='CSPRepPANNeck',
num_repeats=[12, 12, 12, 12],
out_channels=[256, 128, 128, 256, 256, 512],
csp_e=float(1)/2,
),
head=dict(
type='EffiDeHead',
in_channels=[128, 256, 512],
num_layers=3,
begin_indices=24,
anchors=1,
out_indices=[17, 20, 23],
strides=[8, 16, 32],
iou_type='giou',
use_dfl=True,
reg_max=16, #if use_dfl is False, please set reg_max to 0
distill_weight={
'class': 1.0,
'dfl': 1.0,
},
)
)

solver=dict(
optim='SGD',
lr_scheduler='Cosine',
lr0=0.01,
lrf=0.01,
momentum=0.937,
weight_decay=0.0005,
warmup_epochs=3.0,
warmup_momentum=0.8,
warmup_bias_lr=0.1
)

data_aug = dict(
hsv_h=0.015,
hsv_s=0.7,
hsv_v=0.4,
degrees=0.0,
translate=0.1,
scale=0.9,
shear=0.0,
flipud=0.0,
fliplr=0.5,
mosaic=1.0,
mixup=0.1,
)
training_mode = "conv_relu"
62 changes: 62 additions & 0 deletions configs/base/yolov6m_base_finetune.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# YOLOv6 medium/large base model
model = dict(
type='YOLOv6m_base',
depth_multiple=0.80,
width_multiple=0.75,
pretrained=None,
backbone=dict(
type='CSPBepBackbone',
num_repeats=[1, 6, 12, 18, 6],
out_channels=[64, 128, 256, 512, 1024],
csp_e=float(1)/2,
),
neck=dict(
type='CSPRepPANNeck',
num_repeats=[12, 12, 12, 12],
out_channels=[256, 128, 128, 256, 256, 512],
csp_e=float(1)/2,
),
head=dict(
type='EffiDeHead',
in_channels=[128, 256, 512],
num_layers=3,
begin_indices=24,
anchors=1,
out_indices=[17, 20, 23],
strides=[8, 16, 32],
iou_type='giou',
use_dfl=True,
reg_max=16, #if use_dfl is False, please set reg_max to 0
distill_weight={
'class': 1.0,
'dfl': 1.0,
},
)
)

solver = dict(
optim='SGD',
lr_scheduler='Cosine',
lr0=0.0032,
lrf=0.12,
momentum=0.843,
weight_decay=0.00036,
warmup_epochs=2.0,
warmup_momentum=0.5,
warmup_bias_lr=0.05
)

data_aug = dict(
hsv_h=0.0138,
hsv_s=0.664,
hsv_v=0.464,
degrees=0.373,
translate=0.245,
scale=0.898,
shear=0.602,
flipud=0.00856,
fliplr=0.5,
mosaic=1.0,
mixup=0.243,
)
training_mode = "conv_relu"
56 changes: 56 additions & 0 deletions configs/base/yolov6n_base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# YOLOv6 nano base model
model = dict(
type='YOLOv6n_base',
depth_multiple=0.33,
width_multiple=0.25,
pretrained=None,
backbone=dict(
type='EfficientRep',
num_repeats=[1, 6, 12, 18, 6],
out_channels=[64, 128, 256, 512, 1024],
),
neck=dict(
type='RepPANNeck',
num_repeats=[12, 12, 12, 12],
out_channels=[256, 128, 128, 256, 256, 512],
),
head=dict(
type='EffiDeHead',
in_channels=[128, 256, 512],
num_layers=3,
begin_indices=24,
anchors=1,
out_indices=[17, 20, 23],
strides=[8, 16, 32],
iou_type='giou',
use_dfl=False,
reg_max=0 #if use_dfl is False, please set reg_max to 0
)
)

solver=dict(
optim='SGD',
lr_scheduler='Cosine',
lr0=0.01,
lrf=0.01,
momentum=0.937,
weight_decay=0.0005,
warmup_epochs=3.0,
warmup_momentum=0.8,
warmup_bias_lr=0.1
)

data_aug = dict(
hsv_h=0.015,
hsv_s=0.7,
hsv_v=0.4,
degrees=0.0,
translate=0.1,
scale=0.5,
shear=0.0,
flipud=0.0,
fliplr=0.5,
mosaic=1.0,
mixup=0.0,
)
training_mode = "conv_relu"
Loading

0 comments on commit 30b10d2

Please sign in to comment.