(self, segms, bboxes, labels, sizes)
return masks
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.
Decodes back to masks.
Decodes back to masks .
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
def decode ( self , segms , bboxes , labels , sizes ) : 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