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

    img_w, img_h = size
    box = box_cxcywh_to_xyxy(out_bbox)
    box = box * torch.tensor([img_w, img_h, img_w, img_h], dtype=torch.float32)
    return box

    From DETR source: https://github.com/facebookresearch/detr
    (inference notebook)
    
art/estimators/object_detection/detr.py