code: def evaluate(
      dataset_json_path: str,
      result_json_path: str,
      out_dir: str = None,
      type: str = "bbox",
      classwise: bool = False,
      max_detections: int = 500,
      iou_thrs: Union[List[float], float] = None,
      areas: List[int] = [1024, 9216, 10000000000],
      return_dict: bool = False,
  ):
      """
      Args:
          dataset_json_path (str): file path for the coco dataset json file
          result_json_path (str): file path for the coco result json file
          out_dir (str): dir to save eval result
          type (bool): 'bbox' or 'segm'
          classwise (bool): whether to evaluate the AP for each class
          max_detections (int): Maximum number of detections to consider for AP alculation. Default: 500
          iou_thrs (float): IoU threshold used for evaluating recalls/mAPs
          areas (List[int]): area regions for coco evaluation calculations
          return_dict (bool): If True, returns a dict with 'eval_results' 'export_path' fields.
      """
      try:
          from pycocotools.coco import COCO
          from pycocotools.cocoeval import COCOeval
      except ModuleNotFoundError:
          raise ModuleNotFoundError(
              'Please run "pip install -U pycocotools" '
              "to install pycocotools first for coco evaluation."
          )
  
      # perform coco eval
      result = evaluate_core(
          dataset_json_path,
          result_json_path,
          type,
          classwise,
          max_detections,
          iou_thrs,
          out_dir=out_dir,
          areas=areas,
          COCO=COCO,
          COCOeval=COCOeval,
      )
      if return_dict:
          return result
  
file_path: sahi/sahi/scripts/coco_evaluation.py
imports: import itertools
  import json
  import warnings
  from collections import OrderedDict
  from pathlib import Path
  from typing import List, Union
  import fire
  import numpy
  from terminaltables import AsciiTable
label_desc: Use image node_id 3 for calling a global function with example usage: evaluate(dataset_json_path, result_json_path, out_dir, type, classwise, max_detections, iou_thrs, areas, return_dict) and returns: result