class_docstr: Mask Head network of Mask R-CNN.
  
  Args:
      n_class (int): The number of classes including background.
      scales (tuple of floats): The scales of feature maps.
class_docstr_tok: ["Mask","Head","network","of","Mask","R-CNN",".","Args",":","n_class","(","int",")",":","The","number","of","classes","including","background",".","scales","(","tuple","of","floats",")",":","The","scales","of","feature","maps","."]
docstr: Decodes back to masks.
  
  Args:
      segms (iterable of arrays): An iterable of arrays of
          shape :math:`(R_n, n\_class, M, M)`.
      bboxes (iterable of arrays): An iterable of arrays of
          shape :math:`(R_n, 4)`.
      labels (iterable of arrays): An iterable of arrays of
          shape :math:`(R_n,)`.
      sizes (list of tuples of two ints): A list of
          :math:`(H_n, W_n)`, where :math:`H_n` and :math:`W_n`
          are height and width of the :math:`n`-th image.
  
  Returns:
      list of arrays:
      This list contains instance segmentation for each image
      in the batch.
      More precisely, this is a list of boolean arrays of shape
      :math:`(R'_n, H_n, W_n)`, where :math:`R'_n` is the number of
      bounding boxes in the :math:`n`-th image.
docstr_tok: ["Decodes","back","to","masks",".","Args",":","segms","(","iterable","of","arrays",")",":","An","iterable","of","arrays","of","shape",":","math",":","`","(","R_n",",","n\\_class",",","M",",","M",")","`",".","bboxes","(","iterable","of","arrays",")",":","An","iterable","of","arrays","of","shape",":","math",":","`","(","R_n",",","4",")","`",".","labels","(","iterable","of","arrays",")",":","An","iterable","of","arrays","of","shape",":","math",":","`","(","R_n",",",")","`",".","sizes","(","list","of","tuples","of","two","ints",")",":","A","list","of",":","math",":","`","(","H_n",",","W_n",")","`",",","where",":","math",":","`","H_n","`","and",":","math",":","`","W_n","`","are","height","and","width","of","the",":","math",":","`","n","`","-th","image",".","Returns",":","list","of","arrays",":","This","list","contains","instance","segmentation","for","each","image","in","the","batch",".","More","precisely",",","this","is","a","list","of","boolean","arrays","of","shape",":","math",":","`","(","R'_n",",","H_n",",","W_n",")","`",",","where",":","math",":","`","R'_n","`","is","the","number","of","bounding","boxes","in","the",":","math",":","`","n","`","-th","image","."]
code: def decode(self, segms, bboxes, labels, sizes):
      """Decodes back to masks.
  
      Args:
          segms (iterable of arrays): An iterable of arrays of
              shape :math:`(R_n, n\_class, M, M)`.
          bboxes (iterable of arrays): An iterable of arrays of
              shape :math:`(R_n, 4)`.
          labels (iterable of arrays): An iterable of arrays of
              shape :math:`(R_n,)`.
          sizes (list of tuples of two ints): A list of
              :math:`(H_n, W_n)`, where :math:`H_n` and :math:`W_n`
              are height and width of the :math:`n`-th image.
  
      Returns:
          list of arrays:
          This list contains instance segmentation for each image
          in the batch.
          More precisely, this is a list of boolean arrays of shape
          :math:`(R'_n, H_n, W_n)`, where :math:`R'_n` is the number of
          bounding boxes in the :math:`n`-th image.
      """
  
      xp = chainer.backends.cuda.get_array_module(*segms)
      if xp != np:
          raise ValueError(
              "MaskHead.decode only supports numpy inputs for now."
          )
      masks = []
      for bbox, segm, label, size in zip(bboxes, segms, labels, sizes):
          if len(segm) > 0:
              masks.append(
                  segm_to_mask(
                      segm[np.arange(len(label)), label + 1], bbox, size
                  )
              )
          else:
              masks.append(np.zeros((0,) + size, dtype=np.bool))
      return masks
  
file_path: chainercv/chainercv/links/model/fpn/mask_head.py
imports: from __future__ import division
  import numpy
  import chainer
  from chainer.backends import cuda
  import chainer.functions
  from chainer.initializers import HeNormal
  import chainer.links
  from chainercv.links import Conv2DActiv
  from chainercv.utils.bbox.bbox_iou import bbox_iou
  from chainercv.links.model.fpn.mask_utils import mask_to_segm
  from chainercv.links.model.fpn.mask_utils import segm_to_mask
label_desc: Use image node_id 4 for calling the MaskHead obj's underlying member method code with example usage: obj.decode(segms, bboxes, labels, sizes) and returns: masks