code: def get_detection_pred_tuple_from_annotations(
      annotations: Dict,
      annotation_ids: List[int],
      category_mapping: Dict[int, int],
  ) -> DetectionPredTuple:
      labels = []
      scores = []
      boxes = []
      masks = []
  
      for annotation_id in annotation_ids:
          label, box, binary_mask = get_prediction_from_annotation(
              annotations, annotation_id, category_mapping
          )
          labels.append(label)
          scores.append(1.0)
          boxes.append(box)
          masks.append(binary_mask)
  
      labels = torch.tensor(labels, dtype=torch.int64)
      scores = torch.tensor(scores)
      boxes = torch.tensor(boxes)
      masks = torch.tensor(masks).float()
  
      return DetectionPredTuple(labels, scores, boxes, masks)
  
file_path: ml-cvnets/tests/metrics/test_coco_map.py
imports: import argparse
  import json
  import os
  from typing import Dict, List, Tuple
  import numpy
  import torch
  from pycocotools import mask
  from cvnets.models.detection import DetectionPredTuple
  from metrics import coco_map
  from metrics.stats import Statistics
label_desc: Use image node_id 3 for calling a global function with example usage: get_detection_pred_tuple_from_annotations(annotations, annotation_ids, category_mapping) and returns: DetectionPredTuple