diff --git a/README.md b/README.md index 47d1deab..b2f85d6f 100644 --- a/README.md +++ b/README.md @@ -4,149 +4,67 @@ English | [简体中文](README_cn.md) -
-
- - Open In Colab - Open In Kaggle -
-
-cp -## YOLOv6 - -Implementation of paper: -- [YOLOv6 v3.0: A Full-Scale Reloading](https://arxiv.org/abs/2301.05586) 🔥 -- [YOLOv6: A Single-Stage Object Detection Framework for Industrial Applications](https://arxiv.org/abs/2209.02976) - -

- -

- - -## What's New -- [2023.04.28] Release [YOLOv6Lite](configs/yolov6_lite/README.md) models on mobile or CPU. ⭐️ [Mobile Benchmark](#Mobile-Benchmark) -- [2023.03.10] Release [YOLOv6-Face](https://github.com/meituan/YOLOv6/tree/yolov6-face). 🔥 [Performance](https://github.com/meituan/YOLOv6/tree/yolov6-face#performance-on-widerface) -- [2023.03.02] Update [base models](configs/base/README.md) to version 3.0. -- [2023.01.06] Release P6 models and enhance the performance of P5 models. ⭐️ [Benchmark](#Benchmark) -- [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. -- [2022.06.23] Release N/T/S models with excellent performance. - -## Benchmark -| Model | Size | mAPval
0.5:0.95 | SpeedT4
trt fp16 b1
(fps) | SpeedT4
trt fp16 b32
(fps) | Params
(M) | FLOPs
(G) | -| :----------------------------------------------------------- | ---- | :----------------------- | --------------------------------------- | ---------------------------------------- | -------------------- | ------------------- | -| [**YOLOv6-N**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6n.pt) | 640 | 37.5 | 779 | 1187 | 4.7 | 11.4 | -| [**YOLOv6-S**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6s.pt) | 640 | 45.0 | 339 | 484 | 18.5 | 45.3 | -| [**YOLOv6-M**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6m.pt) | 640 | 50.0 | 175 | 226 | 34.9 | 85.8 | -| [**YOLOv6-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6l.pt) | 640 | 52.8 | 98 | 116 | 59.6 | 150.7 | -| | | | | | -| [**YOLOv6-N6**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6n6.pt) | 1280 | 44.9 | 228 | 281 | 10.4 | 49.8 | -| [**YOLOv6-S6**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6s6.pt) | 1280 | 50.3 | 98 | 108 | 41.4 | 198.0 | -| [**YOLOv6-M6**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6m6.pt) | 1280 | 55.2 | 47 | 55 | 79.6 | 379.5 | -| [**YOLOv6-L6**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6l6.pt) | 1280 | 57.2 | 26 | 29 | 140.4 | 673.4 | -
-Table Notes - -- All checkpoints are trained with self-distillation except for YOLOv6-N6/S6 models trained to 300 epochs without distillation. -- Results of the mAP and speed are evaluated on [COCO val2017](https://cocodataset.org/#download) dataset with the input resolution of 640×640 for P5 models and 1280x1280 for P6 models. -- Speed is tested with TensorRT 7.2 on T4. +## YOLOv6-Segmentation + +Implementation of Instance Segmentation based on [YOLOv6 v4.0 code](https://github.com/meituan/YOLOv6/tree/main). + +New Feature +- Designe two types of segment heads referring to YOLACT and SOLO + +## Performance on MSCOCO +| Model | Size | mAPbox
50-95 | mAPmask
50-95 | SpeedT4
trt fp16 b1
(fps) | +| :----------------------------------------------------------- | ---- | :-------------------- | ---------------------- | --------------------------------------- | +| [**YOLOv6-N-seg**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6n_seg.pt) | 640 | 35.3 | 31.2 | 645 | +| [**YOLOv6-S-seg**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6s_seg.pt) | 640 | 44.0 | 38.0 | 292 | +| [**YOLOv6-M-seg**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6m_seg.pt) | 640 | 48.2 | 41.3 | 148 | +| [**YOLOv6-L-seg**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6l_seg.pt) | 640 | 51.1 | 43.7 | 93 | +| [**YOLOv6-X-seg**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6x_seg.pt) | 640 | 52.2 | 44.8 | 47 | +| | | | | | +| [**YOLOv6-N-solo**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6n_solo.pt) | 640 | 35.7 | 31.3 | 506 | +| [**YOLOv6-S-solo**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6s_solo.pt) | 640 | 44.2 | 39.0 | 243 | +| [**YOLOv6-M-solo**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6m_solo.pt) | 640 | 48.3 | 42.2 | 120 | +| [**YOLOv6-L-solo**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6l_solo.pt) | 640 | 50.9 | 44.4 | 75 | +| [**YOLOv6-X-solo**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6x_solo.pt) | 640 | 52.2 | 45.0 | 41 | + +#### Table Notes +- YOLOv6-x-seg models apply YOLACT segment head, and YOLOv6-x-solo models apply SOLO segment head. +- All checkpoints are trained from scratch on COCO for 300 epochs without distillation. +- Results of the mAP and speed are evaluated on [COCO val2017](https://cocodataset.org/#download) dataset with the input resolution of 640×640. +- Speed is tested with TensorRT 8.5 on T4 without post-processing. - Refer to [Test speed](./docs/Test_speed.md) tutorial to reproduce the speed results of YOLOv6. - Params and FLOPs of YOLOv6 are estimated on deployed models. -
-
-Legacy models - -| Model | Size | mAPval
0.5:0.95 | SpeedT4
trt fp16 b1
(fps) | SpeedT4
trt fp16 b32
(fps) | Params
(M) | FLOPs
(G) | -| :----------------------------------------------------------- | ---- | :------------------------------------ | --------------------------------------- | ---------------------------------------- | -------------------- | ------------------- | -| [**YOLOv6-N**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6n.pt) | 640 | 35.9300e
36.3400e | 802 | 1234 | 4.3 | 11.1 | -| [**YOLOv6-T**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6t.pt) | 640 | 40.3300e
41.1400e | 449 | 659 | 15.0 | 36.7 | -| [**YOLOv6-S**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6s.pt) | 640 | 43.5300e
43.8400e | 358 | 495 | 17.2 | 44.2 | -| [**YOLOv6-M**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6m.pt) | 640 | 49.5 | 179 | 233 | 34.3 | 82.2 | -| [**YOLOv6-L-ReLU**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6l_relu.pt) | 640 | 51.7 | 113 | 149 | 58.5 | 144.0 | -| [**YOLOv6-L**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6l.pt) | 640 | 52.5 | 98 | 121 | 58.5 | 144.0 | -- Speed is tested with TensorRT 7.2 on T4. -### Quantized model 🚀 - -| Model | Size | Precision | mAPval
0.5:0.95 | SpeedT4
trt b1
(fps) | SpeedT4
trt b32
(fps) | -| :-------------------- | ---- | --------- | :----------------------- | ---------------------------------- | ----------------------------------- | -| **YOLOv6-N RepOpt** | 640 | INT8 | 34.8 | 1114 | 1828 | -| **YOLOv6-N** | 640 | FP16 | 35.9 | 802 | 1234 | -| **YOLOv6-T RepOpt** | 640 | INT8 | 39.8 | 741 | 1167 | -| **YOLOv6-T** | 640 | FP16 | 40.3 | 449 | 659 | -| **YOLOv6-S RepOpt** | 640 | INT8 | 43.3 | 619 | 924 | -| **YOLOv6-S** | 640 | FP16 | 43.5 | 377 | 541 | - -- Speed is tested with TensorRT 8.4 on T4. -- Precision is figured on models for 300 epochs. -
- -## Mobile Benchmark -| Model | Size | mAPval
0.5:0.95 | sm8350
(ms) | mt6853
(ms) | sdm660
(ms) |Params
(M) | FLOPs
(G) | -| :----------------------------------------------------------- | ---- | -------------------- | -------------------- | -------------------- | -------------------- | -------------------- | -------------------- | -| [**YOLOv6Lite-S**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_s.pt) | 320*320 | 22.4 | 7.99 | 11.99 | 41.86 | 0.55 | 0.56 | -| [**YOLOv6Lite-M**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_m.pt) | 320*320 | 25.1 | 9.08 | 13.27 | 47.95 | 0.79 | 0.67 | -| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 320*320 | 28.0 | 11.37 | 16.20 | 61.40 | 1.09 | 0.87 | -| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 320*192 | 25.0 | 7.02 | 9.66 | 36.13 | 1.09 | 0.52 | -| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 224*128 | 18.9 | 3.63 | 4.99 | 17.76 | 1.09 | 0.24 | - -
-Table Notes - -- From the perspective of model size and input image ratio, we have built a series of models on the mobile terminal to facilitate flexible applications in different scenarios. -- All checkpoints are trained with 400 epochs without distillation. -- Results of the mAP and speed are evaluated on [COCO val2017](https://cocodataset.org/#download) dataset, and the input resolution is the Size in the table. -- Speed is tested on MNN 2.3.0 AArch64 with 2 threads by arm82 acceleration. The inference warm-up is performed 10 times, and the cycle is performed 100 times. -- Qualcomm 888(sm8350), Dimensity 720(mt6853) and Qualcomm 660(sdm660) correspond to chips with different performances at the high, middle and low end respectively, which can be used as a reference for model capabilities under different chips. -- Refer to [Test NCNN Speed](./docs/Test_NCNN_speed.md) tutorial to reproduce the NCNN speed results of YOLOv6Lite. - -
## Quick Start -
+
Install ```shell git clone https://github.com/meituan/YOLOv6 cd YOLOv6 +git checkout yolov6-segss pip install -r requirements.txt ```
- - -
- Reproduce our results on COCO - -Please refer to [Train COCO Dataset](./docs/Train_coco_data.md). - -
-
- Finetune on custom data + Training Single GPU ```shell -# P5 models -python tools/train.py --batch 32 --conf configs/yolov6s_finetune.py --data data/dataset.yaml --fuse_ab --device 0 -# P6 models -python tools/train.py --batch 32 --conf configs/yolov6s6_finetune.py --data data/dataset.yaml --img 1280 --device 0 +python tools/train.py --batch 8 --conf configs/yolov6s_finetune.py --data data/coco.yaml --device 0 ``` Multi GPUs (DDP mode recommended) ```shell -# P5 models -python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --batch 256 --conf configs/yolov6s_finetune.py --data data/dataset.yaml --fuse_ab --device 0,1,2,3,4,5,6,7 -# P6 models -python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --batch 128 --conf configs/yolov6s6_finetune.py --data data/dataset.yaml --img 1280 --device 0,1,2,3,4,5,6,7 +python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --batch 64 --conf configs/yolov6s_finetune.py --data data/coco.yaml --device 0,1,2,3,4,5,6,7 ``` -- fuse_ab: add anchor-based auxiliary branch and use Anchor Aided Training Mode (Not supported on P6 models currently) +- fuse_ab: Not supported in current version - conf: select config file to specify network/optimizer/hyperparameters. We recommend to apply yolov6n/s/m/l_finetune.py when training on your custom dataset. - data: prepare dataset and specify dataset paths in data.yaml ( [COCO](http://cocodataset.org), [YOLO format coco labels](https://github.com/meituan/YOLOv6/releases/download/0.1.0/coco2017labels.zip) ) - make sure your dataset structure as follows: @@ -169,65 +87,31 @@ YOLOv6 supports different input resolution modes. For details, see [How to Set t
-
-Resume training - -If your training process is corrupted, you can resume training by -``` -# single GPU training. -python tools/train.py --resume - -# multi GPU training. -python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --resume -``` -Above command will automatically find the latest checkpoint in YOLOv6 directory, then resume the training process. - -Your can also specify a checkpoint path to `--resume` parameter by -``` -# remember to replace /path/to/your/checkpoint/path to the checkpoint path which you want to resume training. ---resume /path/to/your/checkpoint/path -``` -This will resume from the specific checkpoint you provide. - -
Evaluation -Reproduce mAP on COCO val2017 dataset with 640×640 or 1280x1280 resolution +Reproduce mAP on COCO val2017 dataset with 640×640 resolution ```shell -# P5 models -python tools/eval.py --data data/coco.yaml --batch 32 --weights yolov6s.pt --task val --reproduce_640_eval -# P6 models -python tools/eval.py --data data/coco.yaml --batch 32 --weights yolov6s6.pt --task val --reproduce_640_eval --img 1280 +python tools/eval.py --data data/coco.yaml --batch 32 --weights yolov6s.pt --task val ``` -- verbose: set True to print mAP of each classes. -- do_coco_metric: set True / False to enable / disable pycocotools evaluation method. -- do_pr_metric: set True / False to print or not to print the precision and recall metrics. -- config-file: specify a config file to define all the eval params, for example: [yolov6n_with_eval_params.py](configs/experiment/yolov6n_with_eval_params.py)
Inference -First, download a pretrained model from the YOLOv6 [release](https://github.com/meituan/YOLOv6/releases/tag/0.4.0) or use your trained model to do inference. +First, download a pretrained model from the YOLOv6 [release](https://github.com/meituan/YOLOv6/releases/tag/0.4.1) or use your trained model to do inference. Second, run inference with `tools/infer.py` ```shell -# P5 models python tools/infer.py --weights yolov6s.pt --source img.jpg / imgdir / video.mp4 -# P6 models -python tools/infer.py --weights yolov6s6.pt --img 1280 1280 --source img.jpg / imgdir / video.mp4 ``` If you want to inference on local camera or web camera, you can run: ```shell -# P5 models python tools/infer.py --weights yolov6s.pt --webcam --webcam-addr 0 -# P6 models -python tools/infer.py --weights yolov6s6.pt --img 1280 1280 --webcam --webcam-addr 0 ``` `webcam-addr` can be local camera number id or rtsp address.
@@ -285,4 +169,4 @@ python tools/infer.py --weights yolov6s6.pt --img 1280 1280 --webcam --webcam-ad If you have any questions, welcome to join our WeChat group to discuss and exchange.

-

+

\ No newline at end of file diff --git a/README_cn.md b/README_cn.md index d7181bc0..b3a7e9c2 100644 --- a/README_cn.md +++ b/README_cn.md @@ -4,143 +4,66 @@ 简体中文 | [English](README.md) -## YOLOv6 - -官方论文: -- [YOLOv6 v3.0: A Full-Scale Reloading](https://arxiv.org/abs/2301.05586) 🔥 -- [YOLOv6: A Single-Stage Object Detection Framework for Industrial Applications](https://arxiv.org/abs/2209.02976) - -

- -

- - -## 更新日志 -- [2023.04.28] 发布 移动端轻量级模型 [YOLOv6Lite](configs/yolov6_lite/README.md). ⭐️ [移动端模型指标](#移动端模型指标) -- [2023.03.10] 发布 [YOLOv6-Face](https://github.com/meituan/YOLOv6/tree/yolov6-face). 🔥 [人脸检测模型指标](https://github.com/meituan/YOLOv6/blob/yolov6-face/README_cn.md#widerface-%E6%A8%A1%E5%9E%8B%E6%8C%87%E6%A0%87) -- [2023.03.02] 更新 [基础版模型](configs/base/README_cn.md) 到 3.0 版本 -- [2023.01.06] 发布大分辨率 P6 模型以及对 P5 模型做了全面的升级 ⭐️ [模型指标](#模型指标) -- [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 版本模型 - -## 模型指标 -| 模型 | 输入尺寸 | mAPval
0.5:0.95 | 速度T4
trt fp16 b1
(fps) | 速度T4
trt fp16 b32
(fps) | Params
(M) | FLOPs
(G) | -| :----------------------------------------------------------- | ---- | :------------------------------------ | --------------------------------------- | ---------------------------------------- | -------------------- | ------------------- | -| [**YOLOv6-N**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6n.pt) | 640 | 37.5 | 779 | 1187 | 4.7 | 11.4 | -| [**YOLOv6-S**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6s.pt) | 640 | 45.0 | 339 | 484 | 18.5 | 45.3 | -| [**YOLOv6-M**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6m.pt) | 640 | 50.0 | 175 | 226 | 34.9 | 85.8 | -| [**YOLOv6-L**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6l.pt) | 640 | 52.8 | 98 | 116 | 59.6 | 150.7 | -| | | | | | -| [**YOLOv6-N6**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6n6.pt) | 1280 | 44.9 | 228 | 281 | 10.4 | 49.8 | -| [**YOLOv6-S6**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6s6.pt) | 1280 | 50.3 | 98 | 108 | 41.4 | 198.0 | -| [**YOLOv6-M6**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6m6.pt) | 1280 | 55.2 | 47 | 55 | 79.6 | 379.5 | -| [**YOLOv6-L6**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6l6.pt) | 1280 | 57.2 | 26 | 29 | 140.4 | 673.4 | - -
-表格笔记 - -- 除了 YOLOv6-N6/S6 模型是训练了300轮的结果,其余模型均为自蒸馏训练之后的结果; -- mAP 和速度指标是在 [COCO val2017](https://cocodataset.org/#download) 数据集上评估的,P5模型输入分辨率为 640×640,P6模型输入分辨率为 1280×1280; -- 速度是在 T4 上测试的,TensorRT 版本为 7.2; -- 复现 YOLOv6 的速度指标,请查看 [速度测试](./docs/Test_speed.md) 教程; -- YOLOv6 的参数和计算量是在推理模式下计算的; -
- -
-旧版模型 - -| 模型 | 输入尺寸 | mAPval
0.5:0.95 | 速度T4
trt fp16 b1
(fps) | 速度T4
trt fp16 b32
(fps) | Params
(M) | FLOPs
(G) | -| :----------------------------------------------------------- | ---- | :------------------------------------ | --------------------------------------- | ---------------------------------------- | -------------------- | ------------------- | -| [**YOLOv6-N**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6n.pt) | 640 | 35.9300e
36.3400e | 802 | 1234 | 4.3 | 11.1 | -| [**YOLOv6-T**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6t.pt) | 640 | 40.3300e
41.1400e | 449 | 659 | 15.0 | 36.7 | -| [**YOLOv6-S**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6s.pt) | 640 | 43.5300e
43.8400e | 358 | 495 | 17.2 | 44.2 | -| [**YOLOv6-M**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6m.pt) | 640 | 49.5 | 179 | 233 | 34.3 | 82.2 | -| [**YOLOv6-L-ReLU**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6l_relu.pt) | 640 | 51.7 | 113 | 149 | 58.5 | 144.0 | -| [**YOLOv6-L**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6l.pt) | 640 | 52.5 | 98 | 121 | 58.5 | 144.0 | -- 速度是在 T4 上测试的,TensorRT 版本为 7.2; - -### 量化模型 - -| 模型 | 输入尺寸 | 精度 | mAPval
0.5:0.95 | 速度T4
trt b1
(fps) | 速度T4
trt b32
(fps) | -| :-------------------- | ---- | --------- | :----------------------- | ---------------------------------- | ----------------------------------- | -| **YOLOv6-N RepOpt** | 640 | INT8 | 34.8 | 1114 | 1828 | -| **YOLOv6-N** | 640 | FP16 | 35.9 | 802 | 1234 | -| **YOLOv6-T RepOpt** | 640 | INT8 | 39.8 | 741 | 1167 | -| **YOLOv6-T** | 640 | FP16 | 40.3 | 449 | 659 | -| **YOLOv6-S RepOpt** | 640 | INT8 | 43.3 | 619 | 924 | -| **YOLOv6-S** | 640 | FP16 | 43.5 | 377 | 541 | - -- 速度是在 T4 上测试的,TensorRT 版本为 8.4; -- 精度是在训练 300 epoch 的模型上测试的; - -
- -## 移动端模型指标 - -| 模型 | 输入尺寸 | mAPval
0.5:0.95 | sm8350
(ms) | mt6853
(ms) | sdm660
(ms) |Params
(M) | FLOPs
(G) | -| :----------------------------------------------------------- | ---- | -------------------- | -------------------- | -------------------- | -------------------- | -------------------- | -------------------- | -| [**YOLOv6Lite-S**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_s.pt) | 320*320 | 22.4 | 7.99 | 11.99 | 41.86 | 0.55 | 0.56 | -| [**YOLOv6Lite-M**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_m.pt) | 320*320 | 25.1 | 9.08 | 13.27 | 47.95 | 0.79 | 0.67 | -| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 320*320 | 28.0 | 11.37 | 16.20 | 61.40 | 1.09 | 0.87 | -| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 320*192 | 25.0 | 7.02 | 9.66 | 36.13 | 1.09 | 0.52 | -| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 224*128 | 18.9 | 3.63 | 4.99 | 17.76 | 1.09 | 0.24 | - -
-表格笔记 - -- 从模型尺寸和输入图片比例两种角度,在构建了移动端系列模型,方便不同场景下的灵活应用。 -- 所有权重都经过 400 个 epoch 的训练,并且没有使用蒸馏技术。 -- mAP 和速度指标是在 COCO val2017 数据集上评估的,输入分辨率为表格中对应展示的。 -- 使用 MNN 2.3.0 AArch64 进行速度测试。测速时,采用2个线程,并开启arm82加速,推理预热10次,循环100次。 -- 高通888(sm8350)、天玑720(mt6853)和高通660(sdm660)分别对应高中低端不同性能的芯片,可以作为不同芯片下机型能力的参考。 -- [NCNN 速度测试](./docs/Test_NCNN_speed.md)教程可以帮助展示及复现 YOLOv6Lite 的 NCNN 速度结果。 - -
- -## 快速开始 - -
- 安装 +## YOLOv6-Segmentation + +基于 [YOLOv6 v4.0 分支](https://github.com/meituan/YOLOv6/tree/main) 代码实现实例分割任务。 + +新特性 +- 参考 YOLACT 和 SOLO 设计了两种不同的分割预测头 + +## MSCOCO 模型指标 +| Model | Size | mAPbox
50-95 | mAPmask
50-95 | SpeedT4
trt fp16 b1
(fps) | +| :----------------------------------------------------------- | ---- | :-------------------- | ---------------------- | --------------------------------------- | +| [**YOLOv6-N-seg**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6n_seg.pt) | 640 | 35.3 | 31.2 | 645 | +| [**YOLOv6-S-seg**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6s_seg.pt) | 640 | 44.0 | 38.0 | 292 | +| [**YOLOv6-M-seg**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6m_seg.pt) | 640 | 48.2 | 41.3 | 148 | +| [**YOLOv6-L-seg**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6l_seg.pt) | 640 | 51.1 | 43.7 | 93 | +| [**YOLOv6-X-seg**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6x_seg.pt) | 640 | 52.2 | 44.8 | 47 | +| | | | | | +| [**YOLOv6-N-solo**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6n_solo.pt) | 640 | 35.7 | 31.3 | 506 | +| [**YOLOv6-S-solo**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6s_solo.pt) | 640 | 44.2 | 39.0 | 243 | +| [**YOLOv6-M-solo**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6m_solo.pt) | 640 | 48.3 | 42.2 | 120 | +| [**YOLOv6-L-solo**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6l_solo.pt) | 640 | 50.9 | 44.4 | 75 | +| [**YOLOv6-X-solo**](https://github.com/meituan/YOLOv6/releases/download/0.4.1/yolov6x_solo.pt) | 640 | 52.2 | 45.0 | 41 | + +#### Table Notes +- YOLOv6-x-seg 模型采用 YOLACT 分割头, YOLOv6-x-solo 模型采用 SOLO 分割头. +- 所有权重都经过 300 个 epoch 的训练,并且没有使用蒸馏技术. +- mAP 和速度指标是在 COCO val2017 数据集上评估的,输入分辨率为640x640. +- 速度是在 T4 上测试的,TensorRT 版本为 8.5,且不包括后处理部分. +- YOLOv6 的参数和计算量是在推理模式下计算的. + + + +## Quick Start +
+ 安装 ```shell git clone https://github.com/meituan/YOLOv6 cd YOLOv6 +git checkout yolov6-segss pip install -r requirements.txt ```
-
- 在 COCO 数据集上复现我们的结果 - -请参考教程 [训练 COCO 数据集](./docs/Train_coco_data.md). - -
-
- 在自定义数据集上微调模型 + 训练 单卡 ```shell -# P5 models -python tools/train.py --batch 32 --conf configs/yolov6s_finetune.py --data data/dataset.yaml --fuse_ab --device 0 -# P6 models -python tools/train.py --batch 32 --conf configs/yolov6s6_finetune.py --data data/dataset.yaml --img 1280 --device 0 +python tools/train.py --batch 8 --conf configs/yolov6s_finetune.py --data data/coco.yaml --device 0 ``` 多卡 (我们推荐使用 DDP 模式) ```shell -# P5 models -python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --batch 256 --conf configs/yolov6s_finetune.py --data data/dataset.yaml --fuse_ab --device 0,1,2,3,4,5,6,7 -# P6 models -python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --batch 128 --conf configs/yolov6s6_finetune.py --data data/dataset.yaml --img 1280 --device 0,1,2,3,4,5,6,7 +python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --batch 64 --conf configs/yolov6s_finetune.py --data data/coco.yaml --device 0,1,2,3,4,5,6,7 ``` -- fuse_ab: 增加anchor-based预测分支并使用联合锚点训练模式 (P6模型暂不支持此功能) -- conf: 配置文件路径,里面包含网络结构、优化器配置、超参数信息。如果您是在自己的数据集训练,我们推荐您使用yolov6n/s/m/l_finetune.py配置文件; +- fuse_ab: 当前版本暂不支持 +- conf: 配置文件路径,里面包含网络结构、优化器配置、超参数信息。如果您是在自己的数据集训练,我们推荐您使用yolov6n/s/m/l_finetune.py配置文件 - data: 数据集配置文件,以 COCO 数据集为例,您可以在 [COCO](http://cocodataset.org) 下载数据, 在这里下载 [YOLO 格式标签](https://github.com/meituan/YOLOv6/releases/download/0.1.0/coco2017labels.zip); - 确保您的数据集按照下面这种格式来组织; ``` @@ -154,72 +77,40 @@ python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --batch 128 │ ├── labels │ │ ├── train2017 │ │ ├── val2017 +│ ├── LICENSE +│ ├── README.txt ``` YOLOv6 支持不同的输入分辨率模式,详情请参见 [如何设置输入大小](./docs/About_training_size_cn.md).
-
-恢复训练 - - -如果您的训练进程中断了,您可以这样恢复先前的训练进程。 -``` -# 单卡训练 -python tools/train.py --resume - -# 多卡训练 -python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --resume -``` -上面的命令将自动在 YOLOv6 目录中找到最新保存的模型,然后恢复训练。 -您也可以通过 `--resume` 参数指定要恢复的模型路径 -``` -# 记得把 /path/to/your/checkpoint/path 替换为您要恢复训练的模型权重路径 ---resume /path/to/your/checkpoint/path -``` -这将从您提供的模型路径恢复训练。 - -
+
+ 评估 - -
- 评估 -在 COCO val2017 数据集上复现我们的结果(输入分辨率 640x640 或 1280x1280) +在 COCO val2017 数据集上复现我们的结果 ```shell -# P5 models -python tools/eval.py --data data/coco.yaml --batch 32 --weights yolov6s.pt --task val --reproduce_640_eval -# P6 models -python tools/eval.py --data data/coco.yaml --batch 32 --weights yolov6s6.pt --task val --reproduce_640_eval --img 1280 +python tools/eval.py --data data/coco.yaml --batch 32 --weights yolov6s.pt --task val ``` -- verbose: 如果要打印每一类的精度信息,请设置为 True; -- do_coco_metric: 设置 True / False 来打开或关闭 pycocotools 的评估; -- do_pr_metric: 设置 True / False 来显示或不显示精度和召回的指标; -- config-file: 指定一个包含所有评估参数的配置文件,例如 [yolov6n_with_eval_params.py](configs/experiment/yolov6n_with_eval_params.py)
推理 -首先,从 [release页面](https://github.com/meituan/YOLOv6/releases/tag/0.3.0) 下载一个训练好的模型权重文件,或选择您自己训练的模型; +首先,从 [release页面](https://github.com/meituan/YOLOv6/releases/tag/0.4.1) 下载一个训练好的模型权重文件,或选择您自己训练的模型; 然后,通过 `tools/infer.py`文件进行推理。 + ```shell -# P5 models python tools/infer.py --weights yolov6s.pt --source img.jpg / imgdir / video.mp4 -# P6 models -python tools/infer.py --weights yolov6s6.pt --img 1280 1280 --source img.jpg / imgdir / video.mp4 ``` 如果您想使用本地摄像头或者网络摄像头,您可以运行: ```shell -# P5 models python tools/infer.py --weights yolov6s.pt --webcam --webcam-addr 0 -# P6 models -python tools/infer.py --weights yolov6s6.pt --img 1280 1280 --webcam --webcam-addr 0 ``` `webcam-addr` 可以是本地摄像头的 ID,或者是 RTSP 地址。
@@ -231,14 +122,12 @@ python tools/infer.py --weights yolov6s6.pt --img 1280 1280 --webcam --webcam-ad * [OpenCV Python/C++](./deploy/ONNX/OpenCV) * [OpenVINO](./deploy/OpenVINO) * [TensorRT](./deploy/TensorRT) -* [NCNN](./deploy/NCNN) -* [Android](./deploy/NCNN/Android)
-
+
教程 -* [用户手册(中文版)](https://yolov6-docs.readthedocs.io/zh_CN/latest/) +* [用户手册(中文版)](https://yolov6-docs.readthedocs.io/zh_CN/latest/) * [训练 COCO 数据集](./docs/Train_coco_data.md) * [训练自定义数据集](./docs/Train_custom_data.md) * [测速](./docs/Test_speed.md) @@ -263,4 +152,4 @@ python tools/infer.py --weights yolov6s6.pt --img 1280 1280 --webcam --webcam-ad 如果您有任何问题,欢迎加入我们的微信群一起讨论交流!

-

+

\ No newline at end of file