code: def from_config(cls, cfg, input_shape):
      roi_pooler = cfg["roi_extractor"]
      assert isinstance(roi_pooler, dict)
      kwargs = RoIAlign.from_config(cfg, input_shape)
      roi_pooler.update(kwargs)
      kwargs = {"input_shape": input_shape}
      head = create(cfg["head"], **kwargs)
      return {
          "roi_extractor": roi_pooler,
          "head": head,
      }
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn.initializer import KaimingNormal
  from ppdet.core.workspace import register, create
  from ppdet.modeling.layers import ConvNormLayer
  from .roi_extractor import RoIAlign
  from ..cls_utils import _get_class_default_kwargs
label_desc: Use image node_id 2 for calling the MaskHead obj's underlying member method code with example usage: obj.from_config(cls, cfg, input_shape) and returns: dict