Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 1.49 KB

plugins.md

File metadata and controls

34 lines (26 loc) · 1.49 KB

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