class_docstr: Asymmetric Non-local Neural Networks for Semantic Segmentation.
  
  This head is the implementation of `ANNNet
  <https://arxiv.org/abs/1908.07678>`_.
  
  Args:
      project_channels (int): Projection channels for Nonlocal.
      query_scales (tuple[int]): The scales of query feature map.
          Default: (1,)
      key_pool_scales (tuple[int]): The pooling scales of key feature map.
          Default: (1, 3, 6, 8).
code: def __init__(
      self,
      project_channels,
      query_scales=(1,),
      key_pool_scales=(1, 3, 6, 8),
      **kwargs,
  ):
      super(ANNHead, self).__init__(
          input_transform="multiple_select", **kwargs
      )
      assert len(self.in_channels) == 2
      low_in_channels, high_in_channels = self.in_channels
      self.project_channels = project_channels
      self.fusion = AFNB(
          low_in_channels=low_in_channels,
          high_in_channels=high_in_channels,
          out_channels=high_in_channels,
          channels=project_channels,
          query_scales=query_scales,
          key_pool_scales=key_pool_scales,
          conv_cfg=self.conv_cfg,
          norm_cfg=self.norm_cfg,
          act_cfg=self.act_cfg,
      )
      self.bottleneck = ConvModule(
          high_in_channels,
          self.channels,
          3,
          padding=1,
          conv_cfg=self.conv_cfg,
          norm_cfg=self.norm_cfg,
          act_cfg=self.act_cfg,
      )
      self.context = APNB(
          in_channels=self.channels,
          out_channels=self.channels,
          channels=project_channels,
          query_scales=query_scales,
          key_pool_scales=key_pool_scales,
          conv_cfg=self.conv_cfg,
          norm_cfg=self.norm_cfg,
          act_cfg=self.act_cfg,
      )
  
imports: import torch
  import torch.nn
  from annotator.uniformer.mmcv.cnn import ConvModule
  from ..builder import HEADS
  from ..utils import SelfAttentionBlock
  from .decode_head import BaseDecodeHead
label_desc: Use image node_id 1 to create a new ANNHead object from inherited base classes: BaseDecodeHead with example: obj = ANNHead(project_channels, query_scales, key_pool_scales)