class_docstr: A mask head with several conv layers, plus an upsample layer (with `ConvTranspose2d`).
  Predictions are made with a final 1x1 conv layer.
class_docstr_tok: ["A","mask","head","with","several","conv","layers",",","plus","an","upsample","layer","(","with","`","ConvTranspose2d","`",")",".","Predictions","are","made","with","a","final","1x1","conv","layer","."]
code: def from_config(cls, cfg, input_shape):
      ret = super().from_config(cfg, input_shape)
      conv_dim = cfg.MODEL.ROI_MASK_HEAD.CONV_DIM
      num_conv = cfg.MODEL.ROI_MASK_HEAD.NUM_CONV
      ret.update(
          conv_dims=[conv_dim] * (num_conv + 1),  # +1 for ConvTranspose
          conv_norm=cfg.MODEL.ROI_MASK_HEAD.NORM,
          input_shape=input_shape,
      )
      if cfg.MODEL.ROI_MASK_HEAD.CLS_AGNOSTIC_MASK:
          ret["num_classes"] = 1
      else:
          ret["num_classes"] = cfg.MODEL.ROI_HEADS.NUM_CLASSES
      return ret
  
imports: from typing import List
  import fvcore.nn.weight_init
  import torch
  from torch import nn
  from torch.nn import functional
  from detectron2.config import configurable
  from detectron2.layers import Conv2d, ConvTranspose2d, ShapeSpec, cat, get_norm
  from detectron2.layers.wrappers import move_device_like
  from detectron2.structures import Instances
  from detectron2.utils.events import get_event_storage
  from detectron2.utils.registry import Registry
label_desc: Use image node_id 2 for calling the MaskRCNNConvUpsampleHead obj's underlying member method code with example usage: obj.from_config(cls, cfg, input_shape) and returns: ret