code: def test_evaluate_detections_frames():
      dataset = foz.load_zoo_dataset("quickstart-video").clone()
      dataset.clone_frame_field("detections", "predictions")
  
      classes = dataset.distinct("frames.detections.detections.label")
  
      def jitter(val):
          if isinstance(val, list):
              return [jitter(v) for v in val]
  
          if random.random() < 0.90:
              return val
  
          return random.choice(classes)
  
      values = dataset.values("frames.detections.detections.label")
      dataset.set_values(
          "frames.predictions.detections.label", jitter(values)
      )
  
      print(dataset.count_values("frames.detections.detections.label"))
      print(dataset.count_values("frames.predictions.detections.label"))
  
      #
      # COCO evaluation
      #
  
      EVAL_KEY = "eval_coco"
  
      results = dataset.evaluate_detections(
          "frames.predictions",
          gt_field="frames.detections",
          eval_key=EVAL_KEY,
      )
  
      results.print_report()
  
      print(dataset.bounds(EVAL_KEY + "_tp"))
      print(dataset.bounds(EVAL_KEY + "_fp"))
      print(dataset.bounds(EVAL_KEY + "_fn"))
  
      print(dataset.bounds("frames." + EVAL_KEY + "_tp"))
      print(dataset.bounds("frames." + EVAL_KEY + "_fp"))
      print(dataset.bounds("frames." + 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 7 for calling a global function with example usage: test_evaluate_detections_frames() and returns: random, unknown, val