def padding(bbox, img_shape, pad_scale=0.0):
    """pad bbox with scale

    Args:
        bbox (list):[x1, y1, x2, y2]
        img_shape (tuple): (height, width)
        pad_scale (float): scale for padding

    Returns:
        bbox (list)
    """
    x1, y1, x2, y2 = bbox
    w, h = x2 - x1 + 1, y2 - y1 + 1
    dw = int(w * pad_scale)
    dh = int(h * pad_scale)
    x1 = max(0, x1 - dw)
    x2 = min(img_shape[1], x2 + dw)
    y1 = max(0, y1 - dh)
    y2 = min(img_shape[0], y2 + dh)
    return [int(x1), int(y1), int(x2), int(y2)]
pad bbox with scale

    Args:
        bbox (list):[x1, y1, x2, y2]
        img_shape (tuple): (height, width)
        pad_scale (float): scale for padding

    Returns:
        bbox (list)
    
contrib/QualityInspector/qinspector/utils/bbox_utils.py