code: def get_box_ratios(anno_file):
      """
      get_size_ratios
      :param anno_file: coco anno flile
      :return: size_ratio: (box_long_size / pic_long_size)
      """
      coco_dict = json.load(open(anno_file))
      image_list = coco_dict["images"]
      anno_list = coco_dict["annotations"]
  
      image_id2hw = {}
      for im_dict in image_list:
          im_id = im_dict["id"]
          h, w = im_dict["height"], im_dict["width"]
          image_id2hw[im_id] = (h, w)
  
      box_ratios = []
      for a_dict in anno_list:
          im_id = a_dict["image_id"]
          im_h, im_w = image_id2hw[im_id]
          bbox = a_dict["bbox"]
          x1, y1, w, h = bbox
          pic_long = max(im_h, im_w)
          box_long = max(w, h)
          box_ratios.append(box_long / pic_long)
  
      return np.array(box_ratios)
  
file_path: PaddleDetection/tools/sniper_params_stats.py
imports: import sys
  import json
  import logging
  import numpy
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 2 for calling a global function with example usage: get_box_ratios(anno_file) and returns: np