code: def test_evaluate_detections():
      dataset = foz.load_zoo_dataset("quickstart").clone()
  
      classes = dataset.distinct("predictions.detections.label")
      classes = classes[:9] + [_MISSING]
  
      view = dataset.set_field(
          "predictions.detections.label",
          (F("confidence") > 0.9).if_else(F("label"), None),
      )
  
      #
      # COCO evaluation
      #
  
      EVAL_KEY = "eval_coco"
  
      results = view.evaluate_detections(
          "predictions",
          gt_field="ground_truth",
          eval_key=EVAL_KEY,
          missing=_MISSING,
          method="coco",
      )
  
      results.print_report(classes=classes)
  
      print(dataset.bounds(EVAL_KEY + "_tp"))
      print(dataset.bounds(EVAL_KEY + "_fp"))
      print(dataset.bounds(EVAL_KEY + "_fn"))
      print(dataset.get_evaluation_info(EVAL_KEY))
  
      #
      # Customized COCO evaluation
      #
  
      results = view.evaluate_detections(
          "predictions",
          gt_field="ground_truth",
          eval_key=EVAL_KEY,
          missing=_MISSING,
          method="coco",
          iou=0.5,
          classwise=False,
      )
  
      results.print_report(classes=classes)
  
      print(dataset.bounds(EVAL_KEY + "_tp"))
      print(dataset.bounds(EVAL_KEY + "_fp"))
      print(dataset.bounds(EVAL_KEY + "_fn"))
      print(dataset.get_evaluation_info(EVAL_KEY))
  
      #
      # Open Images evaluation
      #
  
      EVAL_KEY = "eval_oi"
  
      results = view.evaluate_detections(
          "predictions",
          gt_field="ground_truth",
          eval_key=EVAL_KEY,
          missing=_MISSING,
          method="open-images",
      )
  
      results.print_report(classes=classes)
  
      print(dataset.bounds(EVAL_KEY + "_tp"))
      print(dataset.bounds(EVAL_KEY + "_fp"))
      print(dataset.bounds(EVAL_KEY + "_fn"))
      print(dataset.get_evaluation_info(EVAL_KEY))
  
      #
      # Customized Open Images evaluation
      #
  
      results = view.evaluate_detections(
          "predictions",
          gt_field="ground_truth",
          eval_key=EVAL_KEY,
          missing=_MISSING,
          method="open-images",
          iou=0.5,
          classwise=False,
      )
  
      results.print_report(classes=classes)
  
      print(dataset.bounds(EVAL_KEY + "_tp"))
      print(dataset.bounds(EVAL_KEY + "_fp"))
      print(dataset.bounds(EVAL_KEY + "_fn"))
      print(dataset.get_evaluation_info(EVAL_KEY))
  
      #
      # Cleanup
      #
  
      dataset.delete_evaluations()
  
file_path: fiftyone/tests/intensive/evaluation_tests.py
imports: import random
  import unittest
  import numpy
  import eta.core.utils
  import pytest
  import fiftyone
  import fiftyone.zoo
  from fiftyone import ViewField
label_desc: Use image node_id 5 for calling a global function with example usage: test_evaluate_detections() without return types