def filter_boxes(bboxes: Union[FloatTensor, ndarray], max_aspect_ratio: int = 4, 
                    min_area: int = 40*40) -> List[int]:
    """filters a list of bounding boxes given as the 4-tuple (x1, y1, x2, y2)
    by area and aspect ratio. needs to meet both aspect ratio and area criteria to be kept
    returns the indices of the boxes that satisfy the conditions

    Args:
        bboxes (Union[FloatTensor, ndarray]): the boxes
        max_aspect_ratio (int, optional): max aspect ratio before being filtered out. Defaults to 4.
        min_area (int, optional): _description_. Defaults to 40*40.
    Returns:
        List[ind]: list of indices
    """
    inds = []
    for ind,bb in enumerate(bboxes):
        w, h = (bb[2] - bb[0]), (bb[3] - bb[1])
        area = w*h
        aspect = max(w,h)/min(w,h)
        if area > min_area and aspect < max_aspect_ratio:
            inds.append(ind)
    
    return inds
filters a list of bounding boxes given as the 4-tuple (x1, y1, x2, y2)
    by area and aspect ratio. needs to meet both aspect ratio and area criteria to be kept
    returns the indices of the boxes that satisfy the conditions

    Args:
        bboxes (Union[FloatTensor, ndarray]): the boxes
        max_aspect_ratio (int, optional): max aspect ratio before being filtered out. Defaults to 4.
        min_area (int, optional): _description_. Defaults to 40*40.
    Returns:
        List[ind]: list of indices
    
src/marqo/s2_inference/processing/image_utils.py