def METHOD_NAME(masks):
    """
    Args:
        masks: Tensor b,n,h,w
    Returns: List[List[box]]
    """
    batch_bbox = []
    for i, b_masks in enumerate(masks):
        boxes = []
        for mask in b_masks:
            m = mask.nonzero().float()
            if m.numel() > 0:
                box = coords2bboxTensor(m, extend=2)
            else:
                box = torch.Tensor([0, 0, 0, 0]).to(m.device)
            boxes.append(box.unsqueeze(0))
        boxes_t = torch.cat(boxes, 0)
        batch_bbox.append(boxes_t)
    return batch_bbox