code: def sniper_anno_stats(architecture, anno_file):
      """
      sniper_anno_stats
      :param anno_file:
      :return:
      """
  
      (
          anchor_range,
          default_crop_size,
          default_max_bbox_size,
      ) = get_default_params(architecture)
  
      box_ratios = get_box_ratios(anno_file)
  
      box_ratio_p8, box_ratio_p92 = get_percentile(box_ratios, 8, 92)
  
      (
          image_target_sizes,
          valid_box_ratios,
      ) = get_target_size_and_valid_box_ratios(
          anchor_range, box_ratio_p8, box_ratio_p92
      )
  
      valid_ranges = get_valid_ranges(valid_box_ratios)
  
      crop_size = min(
          default_crop_size, min([item for item in image_target_sizes])
      )
      crop_size = int(np.ceil(crop_size / 32.0) * 32.0)
      crop_stride = max(
          min(default_max_bbox_size, crop_size),
          crop_size - default_max_bbox_size,
      )
      logger.info("Result".center(100, "-"))
      logger.info("image_target_sizes: {}".format(image_target_sizes))
      logger.info("valid_box_ratio_ranges: {}".format(valid_ranges))
      logger.info(
          "chip_target_size: {}, chip_target_stride: {}".format(
              crop_size, crop_stride
          )
      )
  
      return {
          "image_target_sizes": image_target_sizes,
          "valid_box_ratio_ranges": valid_ranges,
          "chip_target_size": crop_size,
          "chip_target_stride": crop_stride,
      }
  
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 6 for calling a global function with example usage: sniper_anno_stats(architecture, anno_file) and returns: dict