def revert_rescale_bboxes(out_bbox: "torch.Tensor", size: tuple[int, int]):
    """
    Adapted from DETR source: https://github.com/facebookresearch/detr
    (inference notebook)

    This method reverts bounding box rescaling to match input image size
    """

    img_w, img_h = size
    box = out_bbox / torch.tensor([img_w, img_h, img_w, img_h], dtype=torch.float32).to(out_bbox.device)
    box = box_xyxy_to_cxcywh(box)
    return box

    Adapted from DETR source: https://github.com/facebookresearch/detr
    (inference notebook)

    This method reverts bounding box rescaling to match input image size
    
art/estimators/object_detection/detr.py