def attention_to_bboxs(image: ndarray) -> List[Tuple]:
    """turns attention maps into classless bounding boxes
    expects a single dim attention e.g, attentions.size = (x, y)
    Args:
        image (ndarray): the greyscale image to use to generate bounding boxes for

    Returns:
        List[Tuple]: List of tuples for the bounding boxes
    """
    
    image = _rescale_image(image)
    backtorgb = cv2.cvtColor(image, cv2.COLOR_GRAY2RGB)
    gray = cv2.cvtColor(backtorgb, cv2.COLOR_BGR2GRAY)
    thresh = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)[1]

    # Find contours
    cnts = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
    cnts = cnts[0] if len(cnts) == 2 else cnts[1]
    bboxes = []
    for c in cnts:
        x,y,w,h = cv2.boundingRect(c)
        x1 = x
        x2 = x + w
        y1 = y        
        y2 = y + h
        box = (x1, y1, x2, y2)
        bboxes.append(box)

    return bboxes
turns attention maps into classless bounding boxes
    expects a single dim attention e.g, attentions.size = (x, y)
    Args:
        image (ndarray): the greyscale image to use to generate bounding boxes for

    Returns:
        List[Tuple]: List of tuples for the bounding boxes
    
src/marqo/s2_inference/processing/DINO_utils.py