class_docstr: Dynamic Multi-scale Filters for Semantic Segmentation.
  
  This head is the implementation of
  `DMNet <https://openaccess.thecvf.com/content_ICCV_2019/papers/        He_Dynamic_Multi-Scale_Filters_for_Semantic_Segmentation_            ICCV_2019_paper.pdf>`_.
  
  Args:
      filter_sizes (tuple[int]): The size of generated convolutional filters
          used in Dynamic Convolutional Module. Default: (1, 3, 5, 7).
      fusion (bool): Add one conv to fuse DCM output feature.
class_docstr_tok: ["Dynamic","Multi-scale","Filters","for","Semantic","Segmentation",".","This","head","is","the","implementation","of","`","DMNet","<","https",":","\/\/openaccess.thecvf.com\/content_ICCV_2019\/papers\/","He_Dynamic_Multi-Scale_Filters_for_Semantic_Segmentation_","ICCV_2019_paper.pdf",">","`","_",".","Args",":","filter_sizes","(","tuple","[","int","]",")",":","The","size","of","generated","convolutional","filters","used","in","Dynamic","Convolutional","Module",".","Default",":","(","1",",","3",",","5",",","7",")",".","fusion","(","bool",")",":","Add","one","conv","to","fuse","DCM","output","feature","."]
code: def __init__(self, filter_sizes=(1, 3, 5, 7), fusion=False, **kwargs):
      super(DMHead, self).__init__(**kwargs)
      assert isinstance(filter_sizes, (list, tuple))
      self.filter_sizes = filter_sizes
      self.fusion = fusion
      dcm_modules = []
      for filter_size in self.filter_sizes:
          dcm_modules.append(
              DCM(
                  filter_size,
                  self.fusion,
                  self.in_channels,
                  self.channels,
                  conv_cfg=self.conv_cfg,
                  norm_cfg=self.norm_cfg,
                  act_cfg=self.act_cfg,
              )
          )
      self.dcm_modules = nn.ModuleList(dcm_modules)
      self.bottleneck = ConvModule(
          self.in_channels + len(filter_sizes) * self.channels,
          self.channels,
          3,
          padding=1,
          conv_cfg=self.conv_cfg,
          norm_cfg=self.norm_cfg,
          act_cfg=self.act_cfg,
      )
  
file_path: lavis/lavis/common/annotator/uniformer/mmseg/models/decode_heads/dm_head.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from annotator.uniformer.mmcv.cnn import ConvModule, build_activation_layer, build_norm_layer
  from ..builder import HEADS
  from .decode_head import BaseDecodeHead
label_desc: Use image node_id 1 to create a new DMHead object from inherited base classes: BaseDecodeHead with example: obj = DMHead(filter_sizes, fusion)