class_docstr: Mask predictor head
  
  Parameters
  ----------
  batch_images : int
      Used to reshape output
  classes : iterable of str
      Used to determine number of output channels, and store class names
  mask_channels : int
      Used to determine number of hidden channels
  num_fcn_convs : int, default 0
      number of convolution blocks before deconv layer. For FPN network this is typically 4.
class_docstr_tok: ["Mask","predictor","head","Parameters","--","--","--","--","--","batch_images",":","int","Used","to","reshape","output","classes",":","iterable","of","str","Used","to","determine","number","of","output","channels",",","and","store","class","names","mask_channels",":","int","Used","to","determine","number","of","hidden","channels","num_fcn_convs",":","int",",","default","0","number","of","convolution","blocks","before","deconv","layer",".","For","FPN","network","this","is","typically","4","."]
code: def __init__(
      self,
      batch_images,
      classes,
      mask_channels,
      num_fcn_convs=0,
      norm_layer=None,
      norm_kwargs=None,
      **kwargs,
  ):
      super(Mask, self).__init__(**kwargs)
      self._batch_images = batch_images
      self.classes = classes
      init = mx.init.Xavier(
          rnd_type="gaussian", factor_type="out", magnitude=2
      )
      with self.name_scope():
          if num_fcn_convs > 0:
              self.deconv = nn.HybridSequential()
              for _ in range(num_fcn_convs):
                  self.deconv.add(
                      nn.Conv2D(
                          mask_channels,
                          kernel_size=(3, 3),
                          strides=(1, 1),
                          padding=(1, 1),
                          weight_initializer=init,
                      )
                  )
                  if (
                      norm_layer is not None
                      and norm_layer is SyncBatchNorm
                  ):
                      self.deconv.add(norm_layer(**norm_kwargs))
                  self.deconv.add(nn.Activation("relu"))
              self.deconv.add(
                  nn.Conv2DTranspose(
                      mask_channels,
                      kernel_size=(2, 2),
                      strides=(2, 2),
                      padding=(0, 0),
                      weight_initializer=init,
                  )
              )
              if norm_layer is not None and norm_layer is SyncBatchNorm:
                  self.deconv.add(norm_layer(**norm_kwargs))
          else:
              # this is for compatibility of older models.
              self.deconv = nn.Conv2DTranspose(
                  mask_channels,
                  kernel_size=(2, 2),
                  strides=(2, 2),
                  padding=(0, 0),
                  weight_initializer=init,
              )
          self.mask = nn.Conv2D(
              len(classes),
              kernel_size=(1, 1),
              strides=(1, 1),
              padding=(0, 0),
              weight_initializer=init,
          )
  
imports: from __future__ import absolute_import
  import os
  import warnings
  import mxnet
  from mxnet import autograd
  from mxnet.gluon import nn
  from mxnet.gluon.contrib.nn import SyncBatchNorm
  from .rcnn_target import MaskTargetGenerator
  from ..faster_rcnn import FasterRCNN
  from ..rcnn import custom_rcnn_fpn
label_desc: Use image node_id 1 to create a new Mask object from inherited base classes: nn with example: obj = Mask(batch_images, classes, mask_channels, num_fcn_convs, norm_layer, norm_kwargs)