code: def _compute_AP(precision, recall):
      recall = np.asarray(recall)
      precision = np.asarray(precision)
      inds = np.where(recall[1:] != recall[:-1])[0] + 1
      return np.sum((recall[inds] - recall[inds - 1]) * precision[inds])
  
imports: from collections import defaultdict
  from copy import deepcopy
  import numpy
  import fiftyone.core.plots
  import fiftyone.utils.iou
  from .detection import DetectionEvaluation, DetectionEvaluationConfig, DetectionResults
label_desc: Use image node_id 7 for calling a global function with example usage: _compute_AP(precision, recall) and returns: np