简体中文 | English
官方论文:
模型 | 输入尺寸 | mAPval 0.5:0.95 |
速度T4 trt fp16 b1 (fps) |
速度T4 trt fp16 b32 (fps) |
Params (M) |
FLOPs (G) |
---|---|---|---|---|---|---|
YOLOv6-N | 640 | 37.5 | 779 | 1187 | 4.7 | 11.4 |
YOLOv6-S | 640 | 45.0 | 339 | 484 | 18.5 | 45.3 |
YOLOv6-M | 640 | 50.0 | 175 | 226 | 34.9 | 85.8 |
YOLOv6-L | 640 | 52.8 | 98 | 116 | 59.6 | 150.7 |
YOLOv6-N6 | 1280 | 44.9 | 228 | 281 | 10.4 | 49.8 |
YOLOv6-S6 | 1280 | 50.3 | 98 | 108 | 41.4 | 198.0 |
YOLOv6-M6 | 1280 | 55.2 | 47 | 55 | 79.6 | 379.5 |
YOLOv6-L6 | 1280 | 57.2 | 26 | 29 | 140.4 | 673.4 |
模型 | 输入尺寸 | mAPval 0.5:0.95 |
速度T4 trt fp16 b1 (fps) |
速度T4 trt fp16 b32 (fps) |
Params (M) |
FLOPs (G) |
---|---|---|---|---|---|---|
YOLOv6-N | 640 | 35.9300e 36.3400e |
802 | 1234 | 4.3 | 11.1 |
YOLOv6-T | 640 | 40.3300e 41.1400e |
449 | 659 | 15.0 | 36.7 |
YOLOv6-S | 640 | 43.5300e 43.8400e |
358 | 495 | 17.2 | 44.2 |
YOLOv6-M | 640 | 49.5 | 179 | 233 | 34.3 | 82.2 |
YOLOv6-L-ReLU | 640 | 51.7 | 113 | 149 | 58.5 | 144.0 |
YOLOv6-L | 640 | 52.5 | 98 | 121 | 58.5 | 144.0 |
模型 | 输入尺寸 | 精度 | 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 |
模型 | 输入尺寸 | mAPval 0.5:0.95 |
sm8350 (ms) |
mt6853 (ms) |
sdm660 (ms) |
Params (M) |
FLOPs (G) |
---|---|---|---|---|---|---|---|
YOLOv6Lite-S | 320*320 | 22.4 | 7.99 | 11.99 | 41.86 | 0.55 | 0.56 |
YOLOv6Lite-M | 320*320 | 25.1 | 9.08 | 13.27 | 47.95 | 0.79 | 0.67 |
YOLOv6Lite-L | 320*320 | 28.0 | 11.37 | 16.20 | 61.40 | 1.09 | 0.87 |
YOLOv6Lite-L | 320*192 | 25.0 | 7.02 | 9.66 | 36.13 | 1.09 | 0.52 |
YOLOv6Lite-L | 224*128 | 18.9 | 3.63 | 4.99 | 17.76 | 1.09 | 0.24 |
git clone https://github.com/meituan/YOLOv6
cd YOLOv6
pip install -r requirements.txt
请参考教程 训练 COCO 数据集.
单卡
# 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
多卡 (我们推荐使用 DDP 模式)
# 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
├── coco
│ ├── annotations
│ │ ├── instances_train2017.json
│ │ └── instances_val2017.json
│ ├── images
│ │ ├── train2017
│ │ └── val2017
│ ├── labels
│ │ ├── train2017
│ │ ├── val2017
YOLOv6 支持不同的输入分辨率模式,详情请参见 如何设置输入大小.
如果您的训练进程中断了,您可以这样恢复先前的训练进程。
# 单卡训练
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
这将从您提供的模型路径恢复训练。
# 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
首先,从 release页面 下载一个训练好的模型权重文件,或选择您自己训练的模型;
然后,通过 tools/infer.py
文件进行推理。
# 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
如果您想使用本地摄像头或者网络摄像头,您可以运行:
# 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 地址。
如果您有任何问题,欢迎加入我们的微信群一起讨论交流!
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》