(self, rois, roi_indices)
return rois, roi_indices
Assigns Rois to feature maps according to their size.

        Args:
            rois (array): An array of shape :math:`(R, 4)`, \
                where :math:`R` is the total number of RoIs in the given batch.
            roi_indices (array): An array of shape :math:`(R,)`.

        Returns:
            tuple of two lists:
            :obj:`rois` and :obj:`roi_indices`.

            * **rois**: A list of arrays of shape :math:`(R_l, 4)`, \
                where :math:`R_l` is the number of RoIs in the :math:`l`-th \
                feature map.
            * **roi_indices** : A list of arrays of shape :math:`(R_l,)`.
Assigns Rois to feature maps according to their size.
Assigns Rois to feature maps according to their size .
def distribute(self, rois, roi_indices):
        """Assigns Rois to feature maps according to their size.

        Args:
            rois (array): An array of shape :math:`(R, 4)`, \
                where :math:`R` is the total number of RoIs in the given batch.
            roi_indices (array): An array of shape :math:`(R,)`.

        Returns:
            tuple of two lists:
            :obj:`rois` and :obj:`roi_indices`.

            * **rois**: A list of arrays of shape :math:`(R_l, 4)`, \
                where :math:`R_l` is the number of RoIs in the :math:`l`-th \
                feature map.
            * **roi_indices** : A list of arrays of shape :math:`(R_l,)`.
        """

        size = self.xp.sqrt(self.xp.prod(rois[:, 2:] - rois[:, :2], axis=1))
        level = self.xp.floor(self.xp.log2(
            size / self._canonical_scale + 1e-6)).astype(np.int32)
        # skip last level
        level = self.xp.clip(
            level + self._canonical_level, 0, len(self._scales) - 2)

        masks = [level == l for l in range(len(self._scales))]
        rois = [rois[mask] for mask in masks]
        roi_indices = [roi_indices[mask] for mask in masks]

        return rois, roi_indices
def distribute ( self , rois , roi_indices ) : size = self . xp . sqrt ( self . xp . prod ( rois [ : , 2 : ] - rois [ : , : 2 ] , axis = 1 ) ) level = self . xp . floor ( self . xp . log2 ( size / self . _canonical_scale + 1e-6 ) ) . astype ( np . int32 ) # skip last level level = self . xp . clip ( level + self . _canonical_level , 0 , len ( self . _scales ) - 2 ) masks = [ level == l for l in range ( len ( self . _scales ) ) ] rois = [ rois [ mask ] for mask in masks ] roi_indices = [ roi_indices [ mask ] for mask in masks ] return rois , roi_indices