mmdet/datasets/pipelines/transforms.py
def _filter_boxes(self, patch, boxes):
        """Check whether the center of each box is in the patch.

        Args:
            patch (list[int]): The cropped area, [left, top, right, bottom].
            boxes (numpy array, (N x 4)): Ground truth boxes.
        Returns:
            mask (numpy array, (N,)): Each box is inside or outside the patch.
        """
        center = (boxes[:, :2] + boxes[:, 2:]) / 2
        mask = (center[:, 0] > patch[0]) * (center[:, 1] > patch[1]) * (
                center[:, 0] < patch[2]) * (
                       center[:, 1] < patch[3])
        return mask
Check whether the center of each box is in the patch.

        Args:
            patch (list[int]): The cropped area, [left, top, right, bottom].
            boxes (numpy array, (N x 4)): Ground truth boxes.
        Returns:
            mask (numpy array, (N,)): Each box is inside or outside the patch.
        
Check whether the center of each box is in the patch.
Check whether the center of each box is in the patch .
def _filter_boxes(self, patch, boxes):
        center = (boxes[:, :2] + boxes[:, 2:]) / 2
        mask = (center[:, 0] > patch[0]) * (center[:, 1] > patch[1]) * (
                center[:, 0] < patch[2]) * (
                       center[:, 1] < patch[3])
        return mask
def _filter_boxes ( self , patch , boxes ) : center = ( boxes [ : , : 2 ] + boxes [ : , 2 : ] ) / 2 mask = ( center [ : , 0 ] > patch [ 0 ] ) * ( center [ : , 1 ] > patch [ 1 ] ) * ( center [ : , 0 ] < patch [ 2 ] ) * ( center [ : , 1 ] < patch [ 3 ] ) return mask
Check whether the center of each box is in the patch.
Check whether the center of each box is in the patch .
"""Check whether the center of each box is in the patch.

        Args:
            patch (list[int]): The cropped area, [left, top, right, bottom].
            boxes (numpy array, (N x 4)): Ground truth boxes.
        Returns:
            mask (numpy array, (N,)): Each box is inside or outside the patch.
        """
mask (numpy array, (N,)): Each box is inside or outside the patch.
mask ( numpy array ( N )) : Each box is inside or outside the patch .
self
patch
The cropped area, [left, top, right, bottom].
The cropped area [ left top right bottom ] .
boxes
Ground truth boxes.
Ground truth boxes .