Range King 1c8e581d2c
[Docs] Add two examples of backbone replacement and update plugin.md in EN (#291)
* Update how_to.md

* delete toc

* Update how_to.md

* Update plugin.md

* Update how_to.md

* Update how_to.md

* replace todolist

* fix pretrained model link

* Update how_to.md

* refine configs
2022-11-18 09:55:50 +08:00

1.5 KiB

Plugins

MMYOLO supports adding plugins such as none_local and dropblock after different stages of Backbone. Users can directly manage plugins by modifying the plugins parameter of the backbone in the config. For example, add GeneralizedAttention plugins for YOLOv5. The configuration files are as follows:

_base_ = './yolov5_s-v61_syncbn_8xb16-300e_coco.py'

model = dict(
    backbone=dict(
        plugins=[
            dict(
                cfg=dict(
                    type='GeneralizedAttention',
                    spatial_range=-1,
                    num_heads=8,
                    attention_type='0011',
                    kv_stride=2),
                stages=(False, False, True, True))
        ]))

cfg parameter indicates the specific configuration of the plugin. The stages parameter indicates whether to add plug-ins after the corresponding stage of the backbone. The length of the list stages must be the same as the number of backbone stages.

MMYOLO currently supports the following plugins:

Supported Plugins
  1. CBAM
  2. GeneralizedAttention
  3. NonLocal2d
  4. ContextBlock