def _predict_owl(model, processed_inputs, post_process_function, size):
    """helper to predict with owl

    Args:
        model (_type_): _description_
        processed_inputs (_type_): _description_
        post_process_function (_type_): _description_
        size (_type_): _description_

    Returns:
        _type_: _description_
    """
    with torch.no_grad():
        outputs = model(**processed_inputs)
        # there is a bug in the hf code https://github.com/huggingface/transformers/blob/v4.24.0/src/transformers/models/owlvit/feature_extraction_owlvit.py#L140
        outputs.logits = outputs.logits.to('cpu')
        outputs.pred_boxes = outputs.pred_boxes.to('cpu')
        # Target image sizes (height, width) to rescale box predictions [batch_size, 2]
        target_sizes = torch.Tensor([size[::-1]])
        # Convert outputs (bounding boxes and class logits) to COCO API
        results = post_process_function(outputs=outputs, target_sizes=target_sizes)
        return results
helper to predict with owl

    Args:
        model (_type_): _description_
        processed_inputs (_type_): _description_
        post_process_function (_type_): _description_
        size (_type_): _description_

    Returns:
        _type_: _description_
    
src/marqo/s2_inference/reranking/model_utils.py