class_docstr: Main evaluator class.
class_docstr_tok: ["Main","evaluator","class","."]
docstr: Initializes a DetectionEvaluator object.
  
  Args:
    annotations_loc: a path towards the .json files storing the COCO/2014
      ground truths for object detection. To get the annotations, please
      download the relevant files from https://cocodataset.org/#download
    threshold: a scalar which indicates the lower threshold (inclusive) for
      the scores. Anything below this value will be removed.
    disable_output: if True disables the output produced by the COCO API
docstr_tok: ["Initializes","a","DetectionEvaluator","object",".","Args",":","annotations_loc",":","a","path","towards","the",".json","files","storing","the","COCO\/2014","ground","truths","for","object","detection",".","To","get","the","annotations",",","please","download","the","relevant","files","from","https",":","\/\/cocodataset.org\/","#","download","threshold",":","a","scalar","which","indicates","the","lower","threshold","(","inclusive",")","for","the","scores",".","Anything","below","this","value","will","be","removed",".","disable_output",":","if","True","disables","the","output","produced","by","the","COCO","API"]
code: def __init__(
      self,
      annotations_loc: Optional[str] = None,
      threshold: float = 0.05,
      disable_output: bool = True,
  ):
      """Initializes a DetectionEvaluator object.
  
      Args:
        annotations_loc: a path towards the .json files storing the COCO/2014
          ground truths for object detection. To get the annotations, please
          download the relevant files from https://cocodataset.org/#download
        threshold: a scalar which indicates the lower threshold (inclusive) for
          the scores. Anything below this value will be removed.
        disable_output: if True disables the output produced by the COCO API
      """
      self.annotations = []
      self.annotated_img_ids = []
      self.threshold = threshold
      self.disable_output = disable_output
      if annotations_loc is None:
          annotations_loc = COCO_ANNOTATIONS_PATH
  
      if self.disable_output:
          with open(os.devnull, "w") as devnull:
              with contextlib.redirect_stdout(devnull):
                  self.coco = UniversalCOCO(annotations_loc)
      else:
          self.coco = UniversalCOCO(annotations_loc)
  
      # Dict to translate model labels to COCO category IDs:
      self.label_to_coco_id = {
          i: cat["id"]
          for i, cat in enumerate(self.coco.dataset["categories"])
      }
  
imports: import collections
  import contextlib
  import functools
  import io
  import json
  import os
  import tempfile
  from typing import Any, Dict, List, Optional, Set
  import zipfile
  from absl import logging
  import jax
  import numpy
  import PIL
  from pycocotools.coco import COCO
  from pycocotools.cocoeval import COCOeval
  from tensorflow.io import gfile
label_desc: Use image node_id 1 to create a new DetectionEvaluator object  with example: obj = DetectionEvaluator(annotations_loc, threshold, disable_output)