def scenegraph_to_json(sg):
    """
    Dump an "SceneGraph" object to a dict that's used for evaluation.
    The output will be saved as json.

    Args:
        sg (SceneGraph):

    Returns:
        dict: contains predictions for one image.
    """
    boxes = sg.pred_boxes.tensor.numpy().tolist()
    # for vg evaluation, all boxes should be in XYXY_ABS
    scores = sg.scores.numpy().tolist()
    classes = sg.pred_classes.numpy().tolist()
    rel_scores = sg.rel_scores.numpy().tolist()
    rel_inds = sg.rel_inds.numpy().tolist()


    result = {
        "category_ids": classes,
        "bboxes": boxes,
        "scores": scores,
        "rel_scores": rel_scores,
        "rel_inds": rel_inds
    }
    return result