Skip to content

Commit

Permalink
Add visualization of the base model to the docstring. (#196)
Browse files Browse the repository at this point in the history
* add yolov5 voc training

* format code

* [Feature] Support YOLOv7 inference (#149)

* update

* update

* update

* update

* update

* add docstr

* fix comments

* update

* add video of featmap vis demo (#169)

* [Enhance] YOLOv6 model convert (#165)

* add yolov5 voc training

* fix bug

* fix bug

* fix yolov6 model convert

* update yolov5 modelconvert

* rollback yolov5 model convert

* [Feature] Support VOC Dataset in YOLOv5 (#134)

* add yolov5 voc training

* fix mosaic bug

* fix mosaic bug and temp config

* fix mosaic bug

* update config

* support training on voc dataset

* format code

* format code

* Optimize Code. Change `RandomTransform` to `OneOf`

* Change `OneOf` to `mmcv.RandomChoice`

* fix yolov5coco dataset

* fix yolov5coco dataset

* fix bug, format code

* format config

* format code

* add yolov5 voc training

* rebase

* fix mosaic bug

* update config

* support training on voc dataset

* format code

* format code

* Optimize Code. Change `RandomTransform` to `OneOf`

* Change `OneOf` to `mmcv.RandomChoice`

* fix yolov5coco dataset

* fix yolov5coco dataset

* fix bug, format code

* format code

* add yolov5 voc training

* fix mosaic bug and temp config

* fix mosaic bug

* update config

* support training on voc dataset

* format code

* format code

* Optimize Code. Change `RandomTransform` to `OneOf`

* Change `OneOf` to `mmcv.RandomChoice`

* fix yolov5coco dataset

* fix yolov5coco dataset

* fix bug, format code

* format code

* add yolov5 voc training

* rebase

* fix mosaic bug

* update config

* support training on voc dataset

* format code

* format code

* Optimize Code. Change `RandomTransform` to `OneOf`

* Change `OneOf` to `mmcv.RandomChoice`

* fix yolov5coco dataset

* fix yolov5coco dataset

* fix bug, format code

* format code

* format code

* fix lint

* add unittest

* add auto loss_weight

* add doc; add model log url

* add doc; add model log url

* add doc; add model log url

* add neck vis docstr

* add neck vis docstr

* add backbone model structure diagram

* fix readthedocs.txt

* fix doc vis

* fix vis

* fix vis

* fix vis

* fix vis

Co-authored-by: Haian Huang(深度眸) <[email protected]>
  • Loading branch information
2 people authored and wanghonglie committed Nov 10, 2022
1 parent 7527fc5 commit 6ac40e8
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 1 deletion.
31 changes: 31 additions & 0 deletions mmyolo/models/backbones/base_backbone.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,37 @@
class BaseBackbone(BaseModule, metaclass=ABCMeta):
"""BaseBackbone backbone used in YOLO series.
.. code:: text
Backbone model structure diagram
+-----------+
| input |
+-----------+
v
+-----------+
| stem |
| layer |
+-----------+
v
+-----------+
| stage |
| layer 1 |
+-----------+
v
+-----------+
| stage |
| layer 2 |
+-----------+
v
......
v
+-----------+
| stage |
| layer n |
+-----------+
In P5 model, n=4
In P6 model, n=5
Args:
arch_setting (dict): Architecture of BaseBackbone.
plugins (list[dict]): List of plugins for stages, each dict contains:
Expand Down
93 changes: 93 additions & 0 deletions mmyolo/models/necks/base_yolo_neck.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,99 @@
class BaseYOLONeck(BaseModule, metaclass=ABCMeta):
"""Base neck used in YOLO series.
.. code:: text
P5 neck model structure diagram
+-----------+ +-------+
| bottom_up |--->| out |---> output2
| layer1 | | layer2|
stride=32 +-----------+ +-------+
idx=2 +------+ ^
-----> |reduce| +-----------+
|layer2|--------+-------->| cat |
+------+ | +-----------+
v ^
+--------+ +-----------+
|upsample| |downsample |
| layer2 | | layer1 |
+--------+ +-----------+
stride=16 v ^
idx=1 +------+ +--------+ +-----------+ +-------+
-----> |reduce|--->| cat | | bottom_up |--->| out |---> output1
|layer1| +--------+ | layer0 | | layer1|
+------+ v +-----------+ +-------+
+--------+ ^
|top_down| +-----------+
| layer2 |--->| cat |
+--------+ +-----------+
v ^
+--------+ +-----------+
|upsample| |downsample |
| layer1 | | layer0 |
+--------+ +-----------+
stride=8 v ^
idx=0 +------+ +--------+ |
-----> |reduce|--->| cat | |
|layer0| +--------+ |
+------+ v |
+--------+ | +-------+
|top_down|----------+--------->| out |---> output0
| layer1 | | layer0|
+--------+ +-------+
P6 neck model structure diagram
+-----------+ +-------+
| bottom_up |--->| out |---> output3
| layer2 | | layer3|
stride=64 +-----------+ +-------+
idx=3 +------+ ^
-----> |reduce| +-----------+
|layer3|---------+------->| cat |
+------+ | +-----------+
v ^
+--------+ +-----------+
|upsample| |downsample |
| layer3 | | layer2 |
+--------+ +-----------+
stride=32 v ^
idx=2 +------+ +--------+ +-----------+ +-------+
-----> |reduce|--->| cat | | bottom_up |--->| out |---> output2
|layer2| +--------+ | layer1 | | layer2|
+------+ v +-----------+ +-------+
+--------+ ^
|top_down| +-----------+
| layer3 |--->| cat |
+--------+ +-----------+
v ^
+--------+ +-----------+
|upsample| |downsample |
| layer2 | | layer1 |
+--------+ +-----------+
stride=16 v ^
idx=1 +------+ +--------+ +-----------+ +-------+
-----> |reduce|--->| cat | | bottom_up |--->| out |---> output1
|layer1| +--------+ | layer0 | | layer1|
+------+ v +-----------+ +-------+
+--------+ ^
|top_down| +-----------+
| layer2 |--->| cat |
+--------+ +-----------+
v ^
+--------+ +-----------+
|upsample| |downsample |
| layer1 | | layer0 |
+--------+ +-----------+
stride=8 v ^
idx=0 +------+ +--------+ |
-----> |reduce|--->| cat | |
|layer0| +--------+ |
+------+ v |
+--------+ | +-------+
|top_down|----------+--------->| out |---> output0
| layer1 | | layer0|
+--------+ +-------+
Args:
in_channels (List[int]): Number of input channels per scale.
out_channels (int): Number of output channels (used at each scale)
Expand Down
4 changes: 3 additions & 1 deletion requirements/readthedocs.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
mmcv
mmcv>=2.0.0rc1,<2.1.0
mmdet>=3.0.0rc0
mmengine==0.1.0
torch
torchvision

0 comments on commit 6ac40e8

Please sign in to comment.