class_docstr: Dynamic Mask Head for
  `Instances as Queries <http://arxiv.org/abs/2105.01928>`_
  
  Args:
      num_convs (int): Number of convolution layer.
          Defaults to 4.
      roi_feat_size (int): The output size of RoI extractor,
          Defaults to 14.
      in_channels (int): Input feature channels.
          Defaults to 256.
      conv_kernel_size (int): Kernel size of convolution layers.
          Defaults to 3.
      conv_out_channels (int): Output channels of convolution layers.
          Defaults to 256.
      num_classes (int): Number of classes.
          Defaults to 80
      class_agnostic (int): Whether generate class agnostic prediction.
          Defaults to False.
      dropout (float): Probability of drop the channel.
          Defaults to 0.0
      upsample_cfg (:obj:`ConfigDict` or dict): The config for
          upsample layer.
      conv_cfg (:obj:`ConfigDict` or dict, optional): The convolution
          layer config.
      norm_cfg (:obj:`ConfigDict` or dict, optional): The norm layer config.
      dynamic_conv_cfg (:obj:`ConfigDict` or dict): The dynamic convolution
          layer config.
      loss_mask (:obj:`ConfigDict` or dict): The config for mask loss.
class_docstr_tok: ["Dynamic","Mask","Head","for","`","Instances","as","Queries","<","http",":","\/\/arxiv.org\/abs\/2105.01928",">","`","_","Args",":","num_convs","(","int",")",":","Number","of","convolution","layer",".","Defaults","to","4.","roi_feat_size","(","int",")",":","The","output","size","of","RoI","extractor",",","Defaults","to","14.","in_channels","(","int",")",":","Input","feature","channels",".","Defaults","to","256.","conv_kernel_size","(","int",")",":","Kernel","size","of","convolution","layers",".","Defaults","to","3.","conv_out_channels","(","int",")",":","Output","channels","of","convolution","layers",".","Defaults","to","256.","num_classes","(","int",")",":","Number","of","classes",".","Defaults","to","80","class_agnostic","(","int",")",":","Whether","generate","class","agnostic","prediction",".","Defaults","to","False",".","dropout","(","float",")",":","Probability","of","drop","the","channel",".","Defaults","to","0.0","upsample_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","The","config","for","upsample","layer",".","conv_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","optional",")",":","The","convolution","layer","config",".","norm_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","optional",")",":","The","norm","layer","config",".","dynamic_conv_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","The","dynamic","convolution","layer","config",".","loss_mask","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","The","config","for","mask","loss","."]
code: def __init__(
      self,
      num_convs: int = 4,
      roi_feat_size: int = 14,
      in_channels: int = 256,
      conv_kernel_size: int = 3,
      conv_out_channels: int = 256,
      num_classes: int = 80,
      class_agnostic: bool = False,
      upsample_cfg: ConfigType = dict(type="deconv", scale_factor=2),
      conv_cfg: OptConfigType = None,
      norm_cfg: OptConfigType = None,
      dynamic_conv_cfg: ConfigType = dict(
          type="DynamicConv",
          in_channels=256,
          feat_channels=64,
          out_channels=256,
          input_feat_shape=14,
          with_proj=False,
          act_cfg=dict(type="ReLU", inplace=True),
          norm_cfg=dict(type="LN"),
      ),
      loss_mask: ConfigType = dict(type="DiceLoss", loss_weight=8.0),
      **kwargs,
  ) -> None:
      super().__init__(
          num_convs=num_convs,
          roi_feat_size=roi_feat_size,
          in_channels=in_channels,
          conv_kernel_size=conv_kernel_size,
          conv_out_channels=conv_out_channels,
          num_classes=num_classes,
          class_agnostic=class_agnostic,
          upsample_cfg=upsample_cfg,
          conv_cfg=conv_cfg,
          norm_cfg=norm_cfg,
          loss_mask=loss_mask,
          **kwargs,
      )
      assert (
          class_agnostic is False
      ), "DynamicMaskHead only support class_agnostic=False"
      self.fp16_enabled = False
  
      self.instance_interactive_conv = MODELS.build(dynamic_conv_cfg)
  
file_path: mmdetection/mmdet/models/roi_heads/mask_heads/dynamic_mask_head.py
imports: from typing import List
  import torch
  import torch.nn
  from mmengine.config import ConfigDict
  from torch import Tensor
  from mmdet.models.task_modules import SamplingResult
  from mmdet.registry import MODELS
  from mmdet.utils import ConfigType, InstanceList, OptConfigType, reduce_mean
  from .fcn_mask_head import FCNMaskHead
label_desc: Use image node_id 1 to create a new DynamicMaskHead object from inherited base classes: FCNMaskHead with example: obj = DynamicMaskHead(num_convs, roi_feat_size, in_channels, conv_kernel_size, conv_out_channels, num_classes, class_agnostic, upsample_cfg, conv_cfg, norm_cfg, dynamic_conv_cfg, loss_mask)