def replace_small_boxes(boxes: Union[List[List[float]], List[Tuple[float]], ndarray], 
                min_area: float = 40*40, new_size: Tuple = (100,100)) -> List[Tuple]:
    """replaces bounding boxes given as (x0,y0,x1,y1) and any below min_area
    are replaced with boxes of size new_size
    Args:
        boxes (Union[List[List[float]], List[Tuple[float]], ndarray]): list of bounding boxes
        min_area (float, optional): min area that a box needs to meet to not be 
                                    replaced with one that is new_size. Defaults to 40*40.
        new_size (Tuple, optional): the new size the boxes should be if they are 
                                    less than min_area. Defaults to (100,100).

    Returns:
        List[Tuple]: list of bounding bozes with small ones being replaced with larger ones
    """
    new_boxes = []
    for box in boxes:
        area = (box[2]-box[0])*(box[3] - box[1])
        if area < min_area:
            xc = (box[2]-box[0])/2 + box[0]
            yc = (box[3]-box[1])/2 + box[1]
            box = (xc-new_size[0]/2, yc-new_size[1]/2, xc+new_size[0]/2, yc+new_size[1]/2)
        new_boxes.append(box)

    return new_boxes
replaces bounding boxes given as (x0,y0,x1,y1) and any below min_area
    are replaced with boxes of size new_size
    Args:
        boxes (Union[List[List[float]], List[Tuple[float]], ndarray]): list of bounding boxes
        min_area (float, optional): min area that a box needs to meet to not be 
                                    replaced with one that is new_size. Defaults to 40*40.
        new_size (Tuple, optional): the new size the boxes should be if they are 
                                    less than min_area. Defaults to (100,100).

    Returns:
        List[Tuple]: list of bounding bozes with small ones being replaced with larger ones
    
src/marqo/s2_inference/processing/image_utils.py