code: def build_mask_head(cfg, input_shape):
      """
      Build a mask head defined by `cfg.MODEL.ROI_MASK_HEAD.NAME`.
      """
      name = cfg.MODEL.ROI_MASK_HEAD.NAME
      return ROI_MASK_HEAD_REGISTRY.get(name)(cfg, input_shape)
  
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 3 for calling a global function with example usage: build_mask_head(cfg, input_shape) and returns: ROI_MASK_HEAD_REGISTRY