def resize_bbox(bbox, in_size, out_size):
    """
    Resize bounding boxes according to image resize.
    :param bbox (numpy.ndarray): An array that has a shape (R, 4),
        'R' is the number of the bounding boxes.
        '4' indicates the position of the box, which represents
        (y_min, x_min, y_max, x_max)
    :param in_size (tuple): A tuple of length 2 which indicates
        the height and width of the image before resizing.
    :param out_size (tuple): A tuple of length 2 which indicates
        the height and width of the image after resizing.
    :return (numpy.ndarray): Rescaled bounding boxes according to
        the 'in_size'
    """
    bbox = bbox.copy()
    if len(bbox)==0:
        return bbox
    y_scale = float(out_size[0]) / in_size[0]
    x_scale = float(out_size[1]) / in_size[1]
    bbox[:, 0] = y_scale * bbox[:, 0]
    bbox[:, 2] = y_scale * bbox[:, 2]
    bbox[:, 1] = x_scale * bbox[:, 1]
    bbox[:, 3] = x_scale * bbox[:, 3]
    return bbox