Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Chilicyy committed Jan 12, 2023
1 parent 7fa9ba9 commit b495484
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 21 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,14 @@ pip install -r requirements.txt


<details>
<summary> Training</summary>
<summary> Reproduce our results on COCO</summary>

Please refer to [Train COCO Dataset](./docs/Train_coco_data.md).

</details>

<details open>
<summary> Finetune on custom data</summary>

Single GPU

Expand All @@ -117,9 +123,9 @@ python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --batch 256
# 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
```
- fuse_ab: add anchor-based auxiliary branch and use Anchor Unified Training Mode(Not supported on P6 models)
- fuse_ab: add anchor-based auxiliary branch and use Anchor Unified Training Mode (Not supported on P6 models currently)
- 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 [COCO](http://cocodataset.org) dataset, [YOLO format coco labels](https://github.com/meituan/YOLOv6/releases/download/0.1.0/coco2017labels.zip) and specify dataset paths in data.yaml
- 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:
```
├── coco
Expand All @@ -136,8 +142,7 @@ python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --batch 128
│ ├── README.txt
```


Reproduce our results on COCO ⭐️ [Train COCO Dataset](./docs/Train_coco_data.md)
</details>

<details>
<summary>Resume training</summary>
Expand All @@ -159,13 +164,12 @@ Your can also specify a checkpoint path to `--resume` parameter by
```
This will resume from the specific checkpoint you provide.

</details>
</details>

<details>
<details open>
<summary> Evaluation</summary>

Reproduce mAP on COCO val2017 dataset with 640×640 or 1280x1280 resolution ⭐️
Reproduce mAP on COCO val2017 dataset with 640×640 or 1280x1280 resolution

```shell
# P5 models
Expand Down
25 changes: 16 additions & 9 deletions README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@


## 更新日志
- [2023.01.06] 发布大分辨率 P6 模型以及对 P5 模型做了全面的升级. ⭐️ [模型指标](#模型指标)
- [2022.11.04] 发布 [基础版模型](configs/base/README_cn.md) 简化训练部署流程
- [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 版本模型
- [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 Expand Up @@ -87,7 +87,14 @@ pip install -r requirements.txt
</details>

<details>
<summary> 训练 </summary>
<summary> 在 COCO 数据集上复现我们的结果</summary>

请参考教程 [训练 COCO 数据集](./docs/Train_coco_data.md).

</details>

<details open>
<summary> 在自定义数据集上微调模型 </summary>

单卡

Expand All @@ -106,7 +113,7 @@ python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --batch 256
# 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
```
- fuse_ab: 增加anchor-based预测分支并使用联合锚点训练模式(P6模型暂不支持)
- fuse_ab: 增加anchor-based预测分支并使用联合锚点训练模式 (P6模型暂不支持此功能)
- 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)
- 确保您的数据集按照下面这种格式来组织;
Expand All @@ -123,7 +130,7 @@ python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --batch 128
│ │ ├── val2017
```

在COCO数据集复现我们的结果 ⭐️ [训练 COCO 数据集](./docs/Train_coco_data.md)
</details>

<details>
<summary>恢复训练</summary>
Expand All @@ -147,11 +154,11 @@ python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --resume
这将从您提供的模型路径恢复训练。

</details>
</details>


<details>
<summary> 评估</summary>
在 COCO val2017 数据集上复现我们的结果(输入分辨率 640x640 或 1280x1280) ⭐️
在 COCO val2017 数据集上复现我们的结果(输入分辨率 640x640 或 1280x1280)

```shell
# P5 models
Expand Down Expand Up @@ -194,7 +201,7 @@ python tools/infer.py --weights yolov6s6.pt --img 1280 --source img.jpg / imgdir
<summary> 教程 </summary>

* [训练 COCO 数据集](./docs/Train_coco_data.md)
* [训练自己的数据集](./docs/Train_custom_data.md)
* [训练自定义数据集](./docs/Train_custom_data.md)
* [测速](./docs/Test_speed.md)
* [ YOLOv6 量化教程](./docs/Tutorial%20of%20Quantization.md)
</details>
Expand Down
8 changes: 4 additions & 4 deletions docs/Train_custom_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,21 @@ data_aug = dict(
Single GPU

```shell
python tools/train.py --batch 256 --conf configs/yolov6s_finetune.py --data data/data.yaml --device 0
python tools/train.py --batch 32 --conf configs/yolov6s_finetune.py --data data/dataset.yaml --fuse_ab --device 0
```

Multi GPUs (DDP mode recommended)

```shell
python -m torch.distributed.launch --nproc_per_node 4 tools/train.py --batch 256 --conf configs/yolov6s_finetune.py --data data/data.yaml --device 0,1,2,3
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
```



## 4. Evaluation

```shell
python tools/eval.py --data data/data.yaml --weights output_dir/name/weights/best_ckpt.pt --device 0
python tools/eval.py --data data/data.yaml --weights output_dir/name/weights/best_ckpt.pt --task val --device 0
```


Expand All @@ -142,5 +142,5 @@ python tools/infer.py --weights output_dir/name/weights/best_ckpt.pt --source im
Export as [ONNX](https://github.com/meituan/YOLOv6/tree/main/deploy/ONNX) Format

```shell
python deploy/ONNX/export_onnx.py --weights output_dir/name/weights/best_ckpt.pt --device 0
python deploy/ONNX/export_onnx.py --weights output_dir/name/weights/best_ckpt.pt --simplify --device 0
```

0 comments on commit b495484

Please sign in to comment.