(bbox, size, y_flip=False, x_flip=False)
return bbox
Flip bounding boxes accordingly.

    Args:
        bbox (~numpy.ndarray): See the table below.
        size (tuple): A tuple of length 2. The height and the width
            of the image before resized.
        y_flip (bool): Flip bounding box according to a vertical flip of
            an image.
        x_flip (bool): Flip bounding box according to a horizontal flip of
            an image.

    .. csv-table::
        :header: name, shape, dtype, format

        :obj:`bbox`, ":math:`(R, 4)`", :obj:`float32`, \
        ":math:`(y_{min}, x_{min}, y_{max}, x_{max})`"

    Returns:
        ~numpy.ndarray:
        Bounding boxes flipped according to the given flips.
Flip bounding boxes accordingly.
Flip bounding boxes accordingly .
def flip_bbox(bbox, size, y_flip=False, x_flip=False):
    """Flip bounding boxes accordingly.

    Args:
        bbox (~numpy.ndarray): See the table below.
        size (tuple): A tuple of length 2. The height and the width
            of the image before resized.
        y_flip (bool): Flip bounding box according to a vertical flip of
            an image.
        x_flip (bool): Flip bounding box according to a horizontal flip of
            an image.

    .. csv-table::
        :header: name, shape, dtype, format

        :obj:`bbox`, ":math:`(R, 4)`", :obj:`float32`, \
        ":math:`(y_{min}, x_{min}, y_{max}, x_{max})`"

    Returns:
        ~numpy.ndarray:
        Bounding boxes flipped according to the given flips.

    """
    H, W = size
    bbox = bbox.copy()
    if y_flip:
        y_max = H - bbox[:, 0]
        y_min = H - bbox[:, 2]
        bbox[:, 0] = y_min
        bbox[:, 2] = y_max
    if x_flip:
        x_max = W - bbox[:, 1]
        x_min = W - bbox[:, 3]
        bbox[:, 1] = x_min
        bbox[:, 3] = x_max
    return bbox
def flip_bbox ( bbox , size , y_flip = False , x_flip = False ) : H , W = size bbox = bbox . copy ( ) if y_flip : y_max = H - bbox [ : , 0 ] y_min = H - bbox [ : , 2 ] bbox [ : , 0 ] = y_min bbox [ : , 2 ] = y_max if x_flip : x_max = W - bbox [ : , 1 ] x_min = W - bbox [ : , 3 ] bbox [ : , 1 ] = x_min bbox [ : , 3 ] = x_max return bbox