Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add article and refine tutorial #133

Merged
merged 3 commits into from
Oct 8, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ For different parts from MMDetection, we have also prepared user guides and adva

- Advanced Guides

- [How to](https://mmyolo.readthedocs.io/en/3.x/advanced_guides/index.html#how-to)
- [Data flow](docs/en/advanced_guides/data_flow.md)
- [How to](docs/en/advanced_guides/how_to.md)

## Overview of Benchmark and Model Zoo

Expand Down
5 changes: 4 additions & 1 deletion README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ MMYOLO 用法和 MMDetection 几乎一致,所有教程都是通用的,你也

- 进阶指南

- [How to](https://mmyolo.readthedocs.io/zh_CN/3.x/advanced_guides/index.html#how-to)
- [数据流](docs/zh_cn/advanced_guides/data_flow.md)
- [How to](docs/zh_cn/advanced_guides/how_to.md)

- [解读文章和资源汇总](docs/zh_cn/article.md)

## 基准测试和模型库

Expand Down
2 changes: 1 addition & 1 deletion docs/en/advanced_guides/data_flow.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Mixed image data augmentation update
## Mixed image data augmentation update

Mixed image data augmentation is similar to Mosaic and MixUp, in which the annotation information of multiple images needs to be obtained for fusion during the running process. In the OpenMMLab data augmentation pipeline, other indexes of the dataset are generally not available. In order to achieve the above function, in the YOLOX reproduced in MMDetection, the concept of [MultiImageMixDataset](https://github.com/open-mmlab/mmdetection/blob/master/mmdet/datasets/dataset_wrappers.py#L338) dataset wrapper is proposed.

Expand Down
1 change: 1 addition & 0 deletions docs/en/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ The detailed instruction of MMYOLO is as follows.

4. Refer to the following tutorials for an in-depth look:

- [Data flow](https://mmyolo.readthedocs.io/en/latest/advanced_guides/index.html#data-flow)
- [How to](https://mmyolo.readthedocs.io/en/latest/advanced_guides/index.html#how-to)
2 changes: 1 addition & 1 deletion docs/zh_cn/advanced_guides/data_flow.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 混合类图片数据增强更新
## 混合类图片数据增强更新

混合类图片数据增强是指类似 Mosaic 和 MixUp 一样,在运行过程中需要获取多张图片的标注信息进行融合。 在 OpenMMLab 数据增强 pipeline 中一般是获取不到数据集其他索引的。 为了实现上述功能,在 MMDetection 复现的 YOLOX 中提出了 [MultiImageMixDataset](https://github.com/open-mmlab/mmdetection/blob/master/mmdet/datasets/dataset_wrappers.py#L338) 数据集包装器的概念。

Expand Down
43 changes: 43 additions & 0 deletions docs/zh_cn/article.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 解读文章和资源汇总

这篇文章汇总了 MMYOLO 或相关的 [OpenMMLab](https://www.zhihu.com/people/openmmlab) 解读的部分文章(更多文章和视频见 [OpenMMLabCourse](https://github.com/open-mmlab/OpenMMLabCourse) ),如果您有推荐的文章(不一定是 OpenMMLab 发布的文章,可以是自己写的文章),非常欢迎提 Pull Request 添加到这里。
hhaAndroid marked this conversation as resolved.
Show resolved Hide resolved

## MMYOLO 解读文章和资源

- [MMYOLO 社区倾情贡献,RTMDet 原理社区开发者解读来啦!](https://zhuanlan.zhihu.com/p/569777684)

## MMEngine 解读文章和资源

## MMCV 解读文章和资源

- [手把手教你如何高效地在 MMCV 中贡献算子](https://zhuanlan.zhihu.com/p/464492627)

## MMDetection 解读文章和资源

## 知乎问答和资源

- [深度学习科研,如何高效进行代码和实验管理?](https://www.zhihu.com/question/269707221/answer/2480772257)
- [深度学习方面的科研工作中的实验代码有什么规范和写作技巧?如何妥善管理实验数据?](https://www.zhihu.com/question/268193800/answer/2586000037)
- [COCO 数据集上 1x 模式下为什么不采用多尺度训练?](https://www.zhihu.com/question/462170786/answer/1915119662)
- [MMDetection 中 SOTA 论文源码中将训练过程中 BN 层的 eval 打开?](https://www.zhihu.com/question/471189603/answer/2195540892)
- [基于 PyTorch 的 MMDetection 中训练的随机性来自何处?](https://www.zhihu.com/question/453511684/answer/1839683634)

## PyTorch 解读文章和资源

- [PyTorch1.11 亮点一览:TorchData、functorch、DDP 静态图](https://zhuanlan.zhihu.com/p/486222256)
- [PyTorch1.12 亮点一览:DataPipe + TorchArrow 新的数据加载与处理范式](https://zhuanlan.zhihu.com/p/537868554)
- [PyTorch 源码解读之 nn.Module:核心网络模块接口详解](https://zhuanlan.zhihu.com/p/340453841)
- [PyTorch 源码解读之 torch.autograd:梯度计算详解](https://zhuanlan.zhihu.com/p/321449610)
- [PyTorch 源码解读之 torch.utils.data:解析数据处理全流程](https://zhuanlan.zhihu.com/p/337850513)
- [PyTorch 源码解读之 torch.optim:优化算法接口详解](https://zhuanlan.zhihu.com/p/346205754)
- [PyTorch 源码解读之 DP & DDP:模型并行和分布式训练解析](https://zhuanlan.zhihu.com/p/343951042)
- [PyTorch 源码解读之 BN & SyncBN:BN 与 多卡同步 BN 详解](https://zhuanlan.zhihu.com/p/337732517)
- [PyTorch 源码解读之 torch.cuda.amp: 自动混合精度详解](https://zhuanlan.zhihu.com/p/348554267)
- [PyTorch 源码解读之 cpp_extension:揭秘 C++/CUDA 算子实现和调用全流程](https://zhuanlan.zhihu.com/p/348555597)
- [PyTorch 源码解读之即时编译篇](https://zhuanlan.zhihu.com/p/361101354)
- [PyTorch 源码解读之分布式训练了解一下?](https://zhuanlan.zhihu.com/p/361314953)
- [PyTorch 源码解读之 torch.serialization & torch.hub](https://zhuanlan.zhihu.com/p/364239544)

## 其他

- [Type Hints 入门教程,让代码更加规范整洁](https://zhuanlan.zhihu.com/p/519335398)
6 changes: 6 additions & 0 deletions docs/zh_cn/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@

advanced_guides/index.rst

.. toctree::
:maxdepth: 1
:caption: 解读文章和资源汇总

article.md

.. toctree::
:maxdepth: 1
:caption: 接口文档(英文)
Expand Down
3 changes: 3 additions & 0 deletions docs/zh_cn/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,7 @@ MMYOLO 文件结构和 MMDetection 完全一致。为了能够充分复用 MMDet

4. 参考以下教程深入了解:

- [数据流](https://mmyolo.readthedocs.io/zh_cn/latest/advanced_guides/index.html#数据流)
- [How to](https://mmyolo.readthedocs.io/zh_cn/latest/advanced_guides/index.html#how-to)

5. [解读文章和资源汇总](article.md)
18 changes: 14 additions & 4 deletions docs/zh_cn/user_guides/yolov5_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ python tools/train.py configs/yolov5/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon.
# 命令行中设置 model.backbone.frozen_stages=4
cd mmyolo
python tools/train.py configs/yolov5/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon.py \
--cfg-options load_from='yolov5_s-v61_syncbn_fast_8xb16-300e_coco_20220918_084700-86e02187.pth' model.backbone.frozen_stages=4
--cfg-options load_from='yolov5_s-v61_syncbn_fast_8xb16-300e_coco_20220918_084700-86e02187.pth' model.backbone.frozen_stages=4 custom_hooks=None
```

### 可视化相关
### 训练验证中可视化相关

#### 验证阶段可视化

Expand Down Expand Up @@ -221,15 +221,25 @@ visualizer = dict(vis_backends=[dict(type='LocalVisBackend'),dict(type='Tensorbo
tensorboard --logdir=work_dirs/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon
```

### 模型推理
## 模型测试

如果你训练时候设置了 `custom_hooks=None`,那么在模型测试过程中依然需要设置 `custom_hooks=None`

```shell
python tools/test.py configs/yolov5/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon.py \
work_dirs/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon/epoch_300.pth \
--show-dir show_results --cfg-options custom_hooks=None
```

如果你没有设置 `custom_hooks=None`,那么测试命令如下:

```shell
python tools/test.py configs/yolov5/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon.py \
work_dirs/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon/epoch_300.pth \
--show-dir show_results
```

运行以上推理命令,推理结果图片会自动保存至 `work_dirs/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon/{timestamp}/show_results` 文件夹中。下面为其中一张结果图片,左图为实际标注,右图为模型推理结果。
运行以上测试命令,推理结果图片会自动保存至 `work_dirs/yolov5_s-v61_syncbn_fast_1xb4-300e_balloon/{timestamp}/show_results` 文件夹中。下面为其中一张结果图片,左图为实际标注,右图为模型推理结果。

<div align=center>
<img src="https://user-images.githubusercontent.com/27466624/190913272-f99709e5-c798-46b8-aede-30f4e91683a3.jpg" alt="result_img"/>
Expand Down